Quote Originally Posted by Kiter View Post
Why is it not changing back to 6 ("sckConnecting")??
Because as far as it's concerned it's still connected. When your device shuts down it will trigger the Winsock_Close event in your program. It's up to you to recognise that event, close the socket and then try to re-connect

Code:
Private Sub Winsock1_Close()
'
' Server has closed the connection
' Close our socket and attempt to reconnect
'
Winsock1.Close
Winsock1.Connect
End Sub