in reply to Re: How to monitor TCP Resets using Sockets
in thread How to monitor TCP Resets using Sockets
Basically, if you are a "writer", you can tell very quickly that the pipe is not open anymore for write (although there may still potentially be stuff in it that hasn't been read yet).
However if you are "reader", you can't tell the difference between "my partner is really slow" and "he isn't there anymore". You have to conclude that "he isn't there anymore" when he is really, really slow. It is possible to still be reading even after your partner has long since died, and the socket is closed as far as he is concerned.
If I am controlling the protocol at both ends, and it is possible for me to do so, I will send an "in-band" signal (Maybe a CTL-D or whatever) to the client to let him know that "I'm done and signing off". This is done to circumvent the client time-out.
An "in-band" signal is part of the data stream which the client has to parse. An "out-of-band" signal, like a SIGPIPE signal (for the writer) is not transferred via the data communication stream.
There simply is not an out-of-band signal to notify the receiver that the transmitter has "gone off the air". "The BBC concludes our nightly broadcast" is the way that it is done - that is an example of an "in-band" signal.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: How to monitor TCP Resets using Sockets
by zwon (Abbot) on Dec 31, 2011 at 09:47 UTC | |
by Marshall (Canon) on Jan 02, 2012 at 04:28 UTC |