connect method

Future<void> connect()

Opens the socket again after stop or a background close (bootstraps first when it never ran).

Implementation

Future<void> connect() async {
  if (_disposed) return;
  if (!_started) {
    await start();
    return;
  }
  if (_state.phase != ChatPhase.ready || _socket == null) {
    await _bootstrapAndConnect();
    return;
  }
  _socket!.connect();
}