My form sends a winsock.close message when a pc is properly shut down.

but when a pc is improperly shut down (accidentally unplugged), my form will not have the chance to send a winsock.close message thus the server detects the improperly shutdown client as still online.

what should i do in the server for me to detect the connection if the client is improperly shutdown?

i tried using checking the sckServer.State but the state in the server is still sckConnected.

Please help guys! Thanks!