disconnect method
Disconnects and clears all in-memory connection state.
Implementation
Future<void> disconnect() async {
_intentionalClose = true;
final client = _client;
_client = null;
_principal = null;
_hubUri = null;
await client?.close();
}