Advertisement

09.11.2007 at 01:16PM PDT, ID: 22821628
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.6

Do sockets timeout?

Asked by jvalescu in C# Programming Language, .NET Framework 2.x, WInsock

Tags: , , ,

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:Unable 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.SocketExceptionA 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(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at System.Net.Sockets.Socket.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size,)
-- End of inner exception stack trace --
at   System.Net.Sockets.Socket.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size,)
at Keithley2701Classlib.General.KI2701Read(String& KIdata) in C:\WIL\2701ClassLib\General.cs:line 245


Line 245 has this exception:

System.NullReferenceException was unhandled
  Message="Object reference not set to an instance of an object."
  Source="Inhallation"
  StackTrace:
       at Inhallation.frmVoltmeter.read() in C:\WIL\Inhallation\frmVoltmeter.cs:line 453
       at Inhallation.frmVoltmeter.Start_Environmental_Monitoring() in C:\WIL\Inhallation\frmVoltmeter.cs:line 207
       at Inhallation.frmVoltmeter.btnStart_Click(Object sender, EventArgs e) in C:\WIL\Inhallation\frmVoltmeter.cs:line 906
       at System.Windows.Forms.Control.OnClick(EventArgs e)
       at System.Windows.Forms.Button.OnClick(EventArgs e)
       at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
       at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ButtonBase.WndProc(Message& m)
       at System.Windows.Forms.Button.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
       at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.Run(Form mainForm)
       at Keithley2701ClassLib.frmMain.Main() in C:\WIL\Inhallation\frmMain.cs:line 260

Start Free Trial
[+][-]09.11.2007 at 08:30PM PDT, ID: 19873716

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]09.13.2007 at 01:56PM PDT, ID: 19887071

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: C# Programming Language, .NET Framework 2.x, WInsock
Tags: socket, timeout, failed, connection
Sign Up Now!
Solution Provided By: jdbviper
Participating Experts: 2
Solution Grade: B
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628