Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
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!
0 · ·