Re: TcpClient read/write timeouts do not timeout



(It appears my reply isn't appearing, so I'll write again:)

Hard to say without seeing an actual concise-but-complete code example.

I use the code from this example:
http://msdn.microsoft.com/en-us/library/system.net.sockets.tcpclient.aspx
(except I implement timeouts.)


Are you having
read/write problems or connection problems?

It connects fine. The server sees the connection. The client gets
stuck in the stream.Write() call, and the server never sees any data
from it. (This occurs 1% o the time. The other 99%, everything works
fine.)


Beware of using the TCP timeout: once the timeout occurs, the socket is no
longer usable.

Ok.


Depending on your intent, you may be better off
implementing timeout logic yourself elsewhere.

The implementation is: 1. connect, 2. send data, 3. get reply, 4.
disconnect, so TcpClient seemed like the answer, since it was
synchronous, just as I wanted it to be, to avoid the hassle of
asynchronous code.

I even TURNED THE SERVER OFF once the stream.Write() got hung up, to
see if that would end the stream.Write() call... and it doesn't.
Write() should end because there's NO server and because the timeout
is 1 minute, and it's been 20 minutes now. Even if my server code is
a mess of bugs, this makes no sense.


Thanks, Pete,

Zytan
.



Relevant Pages

  • Re: TcpClient read/write timeouts do not timeout
    ... I believe I have a bug in the server, but still, the timeouts should ... Are you having read/write problems or connection problems? ... Beware of using the TCP timeout: once the timeout occurs, the socket is no longer usable. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Is this an easy fix or complicated one?
    ... that box that opens, properties will be listed..if it isn't working, post ... >> within the required timeout. ... The server %1 did not register with DCOM within the required ... >> If the problem continues to occur, contact the program vendor. ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: RWW timing out
    ... > RWW site as: ... > - Remote Web Workplace timeout ... Restart the IIS Service or restart the SBS Server. ...
    (microsoft.public.windows.server.sbs)
  • RE: RWW timing out
    ... Thank you for posting to the SBS Newsgroup. ... - Remote Web Workplace timeout ... Restart the IIS Service or restart the SBS Server. ...
    (microsoft.public.windows.server.sbs)
  • Re: SQL/ADO (2.8) Timeout Error - Cant resolve
    ... > timeout limit. ... > server, or the code itself or various other issues. ... You can either use Network Monitor to get a sniff of network ... the stored procedure code, then launch the sp from the Access database ...
    (microsoft.public.sqlserver.clients)