Always disconnect the socket in the end.