I am communicating with a Digital Acquisition Controller over TCP/IP and the sockets class. After it starts running for about 2 minutes (or sometimes less) it just loses communication: i.e., I cant ping it. I've tested the physical connection by connecting directly to its internal web interface and letting it randomly sample. I let this go overnight and there was no problem. My socket code was cloned from the manufacturers example, which exhibits the same problem. Is there some special flag or advanced parameter I should try?
Here is a new error I am getting:
System.IO.IOException:Unab
le to read data from the transport connection: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond, --> System.Net.Sockets.SocketE
xceptionA connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
at System.Net.Sockets.Socket.
Receive(By
te[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at System.Net.Sockets.Socket.
NetworkStr
eam.Read(B
yte[] buffer, Int32 offset, Int32 size,)
-- End of inner exception stack trace --
at System.Net.Sockets.Socket.
NetworkStr
eam.Read(B
yte[] buffer, Int32 offset, Int32 size,)
at Keithley2701Classlib.Gener
al.KI2701R
ead(String
& KIdata) in C:\WIL\2701ClassLib\Genera
l.cs:line 245
Line 245 has this exception:
System.NullReferenceExcept
ion was unhandled
Message="Object reference not set to an instance of an object."
Source="Inhallation"
StackTrace:
at Inhallation.frmVoltmeter.r
ead() in C:\WIL\Inhallation\frmVolt
meter.cs:l
ine 453
at Inhallation.frmVoltmeter.S
tart_Envir
onmental_M
onitoring(
) in C:\WIL\Inhallation\frmVolt
meter.cs:l
ine 207
at Inhallation.frmVoltmeter.b
tnStart_Cl
ick(Object
sender, EventArgs e) in C:\WIL\Inhallation\frmVolt
meter.cs:l
ine 906
at System.Windows.Forms.Contr
ol.OnClick
(EventArgs
e)
at System.Windows.Forms.Butto
n.OnClick(
EventArgs e)
at System.Windows.Forms.Butto
n.OnMouseU
p(MouseEve
ntArgs mevent)
at System.Windows.Forms.Contr
ol.WmMouse
Up(Message
& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Contr
ol.WndProc
(Message& m)
at System.Windows.Forms.Butto
nBase.WndP
roc(Messag
e& m)
at System.Windows.Forms.Butto
n.WndProc(
Message& m)
at System.Windows.Forms.Contr
ol.Control
NativeWind
ow.OnMessa
ge(Message
& m)
at System.Windows.Forms.Contr
ol.Control
NativeWind
ow.WndProc
(Message& m)
at System.Windows.Forms.Nativ
eWindow.De
buggableCa
llback(Int
Ptr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.Unsaf
eNativeMet
hods.Dispa
tchMessage
W(MSG& msg)
at System.Windows.Forms.Appli
cation.Com
ponentMana
ger.System
.Windows.F
orms.Unsaf
eNativeMet
hods.IMsoC
omponentMa
nager.FPus
hMessageLo
op(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Appli
cation.Thr
eadContext
.RunMessag
eLoopInner
(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Appli
cation.Thr
eadContext
.RunMessag
eLoop(Int3
2 reason, ApplicationContext context)
at System.Windows.Forms.Appli
cation.Run
(Form mainForm)
at Keithley2701ClassLib.frmMa
in.Main() in C:\WIL\Inhallation\frmMain
.cs:line 260
Start Free Trial