Make sure the socket gets closed