I am building a Client/Server application in VB.NET 2008. I am looking for the best way to detect when a connection is dropped (not when the server program explicitly disconnects the client, but when the line is ‘cut’).
I do not want to make a custom protocol for sending and receiving packets every few seconds to detect if the connection is still available.
Also, I am aware about the NetworkChange.NetworkAddre
ssChanged event, from the following article on MSDN:
ssChanged event detects only when the client unplugs his own network cable. It is not useful if the line is dropped somewhere else between the client and the server.
I know the sockets have a KeepAlive option:
but is very little documentation.
I need an implementation of this in VB.NET 2008, or an solution of any kind for raising an event when the connection is dropped somewhere else between the client and the server.