disconnect method

  1. @override
Future<void> disconnect()

Disconnects from the service

Implementation

@override
Future<void> disconnect() async {
  // Fail-first so any future returned by idleStart(waitForContinuation:true)
  // is settled before the socket is torn down; otherwise callers awaiting
  // the continuation would hang forever since onConnectionError is not
  // invoked on an expected disconnect.
  _failPendingIdleContinuation('client disconnected');
  await _eventController.close();

  return super.disconnect();
}