Stop when closed the socket.