connect method

  1. @override
  2. @visibleForTesting
FutureOr<void> connect(
  1. String url
)
override

Connects to the WebSocket server. url - the URL that was used to establish the connection.

Implementation

@override
@visibleForTesting
FutureOr<void> connect(String url) async {
  _stateController.add(_state = WebSocketClientState.connecting(url: url));
  await Future<void>.delayed(const Duration(milliseconds: 25));
  _stateController.add(_state = WebSocketClientState.open(url: url));
}