stop method

Future<void> stop()

Closes the socket and stops retrying; start may be called again.

Implementation

Future<void> stop() async {
  _started = false;
  _bootstrapTimer?.cancel();
  _bootstrapTimer = null;
  _closeSocket();
  _emit(_state.copyWith(connection: HatangConnectionState.disconnected));
}