close the socket