I need to detect if a TCP connection is broken. At first, I tried to set SO_KEEPALIVE. However, there is not parameter to set the timeout. I know that in registry I can set the timeout (which default is 10 min for Windows), but this will affect all the TCP/IP connection.
I would like to take a second alternative: now and then call send() to transmit some dummy packet to another end. I expect the WSAECONNRESET error returned, which it does not, and after a few 10 secs, the select() returned error. I run this test in a intranet, so I am not sure whether is it detected by Microsoft Network or TCP.
Can anybody help me?