I have a client server (windows desktop mac server), I want to know if there is a current connection between the two machines so I can update a UI to reflect the remote machine is connected.
I use the following code
For Each tcp As TCPSocket In activeSockets
if systcp(tcp).IsConnected=true then
for i as integer = 0 to listbox1.RowCount-1
' at this point it's alive!!!!
if I close or break out of the client app then isconnected returns false (great)
if I disable the network adapter on the remote machine, isconnected does not switch to false, even after some minutes waiting.
Is there a way to confirm a connection has been dropped rather than sending data every few seconds to the client and timing how long it takes to reply?
Or is there a better way to do this.