Updating PM3 connection when socket closed

Closing the sender when connection to server is lost