in reply to Re^2: syswrite and closed sockets
in thread syswrite and closed sockets
Have the server use shutdown to make the closing of the connection be more explicit to the clients.
I consider it a bug or design flaw that some TCP network stacks don't appear to do the equivalent of shutdown when a socket is closed, which means that the client won't know about the closure until it tries to send more data and waits a short while for the reply to that data to show up and tell it that the connection is no longer valid.
Updates:
See also (tye)Re: shutdown vs. close on INET sockets.
If you don't have control over the server, then you can change your test to have the client:
It shouldn't take very long for the response to a write to a closed socket to make it back to the client. However, if you shut off the server computer or break the network connection to it, then it may take 8 minutes before the client is willing to give up on the server.
- tye
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: syswrite and closed sockets (shutdown)
by InfiniteLoop (Hermit) on Aug 11, 2006 at 18:35 UTC |