closeConnection
Close the connection to the server if it's open.
This can be used to force a reconnection to the server, for instance when new auth tokens should be passed to the headers.
The given reason will be propagated to active subscriptions.