How can I detect connection loss on a socket?


I'm developing a C/S application using WINNT. My problem is, that
I need to detect, when a socket connection gets broken. Somehow,
Win2k manages to notice this event and sends a close to all open
sockets. NT however does not do this. In the MS KB (Q140325) I found
that it is possible to set a socket to send keepalive packets
after a certain idle time on a socket. I also changed the idle time
value in the registry to 10 secs, but it does not work. I don't get
any event signalling the connection breakdown. When I do a
'getsockopt()' to find out whether SO_KEEPALIVE is really set on
the socket in question, it tells me, that it is set.

Has anyone an idea of what I did wrong. Does anyone know which
event the OS will send, in case a keepalive packet is not ack'ed?

All help will be greatly appreciated!


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!