I have a situation -
There is a TCP connection between A-->B in established state. A sends a few bytes to B and then terminates itself. The B is neither doing send() or recv().
I would like to know if there is a way to know that the connection is broken.
I know that, for broken connections recv() returns '0'. But in the above situation - A has sent some data to B, so the first (one or multiple) recv() would return me the sent data and finally I would get recv() == 0. But I want to know about the broken connection, without having to pump-out all data from the recv-buffer.
- I would like to get a notification about the incoming FIN/RST packets
- I have keep-alive activated, so I would like to get a notification when the keep-alive packet is unreplied by the partner
Thanks, Sandeep