connect function

Future<WebSocketChannel> connect(
  1. Uri uri, {
  2. Iterable<String>? protocols,
  3. Function? connectedCallback,
  4. Duration? connectTimeout,
})

Creates a new WebSocket connection.

Connects to uri using and returns a channel that can be used to communicate over the resulting socket.

The optional protocols parameter is the same as WebSocket.connect.

Implementation

Future<WebSocketChannel> connect(Uri uri,
    {Iterable<String>? protocols,
    Function? connectedCallback,
    Duration? connectTimeout}) {
  throw UnsupportedError('No implementation of the connect api provided');
}