AdapterWebSocketChannel.connect constructor

AdapterWebSocketChannel.connect(
  1. Uri url, {
  2. Iterable<String>? protocols,
})

Creates a new WebSocket connection.

If provided, the protocols argument indicates that subprotocols that the peer is able to select. See RFC-6455 1.9.

After construction, the AdapterWebSocketChannel may not be connected to the peer. The ready future will complete after the channel is connected. If there are errors creating the connection the ready future will complete with an error.

Implementation

factory AdapterWebSocketChannel.connect(Uri url,
        {Iterable<String>? protocols}) =>
    AdapterWebSocketChannel(WebSocket.connect(url, protocols: protocols));