sendBytes method

  1. @override
void sendBytes(
  1. Uint8List b
)
override

Sends binary data to the connected peer.

Throws WebSocketConnectionClosed if the WebSocket is closed (either through close or by the peer).

Data sent through sendBytes will be silently discarded if the peer is disconnected but the disconnect has not yet been detected.

Implementation

@override
void sendBytes(Uint8List b) {
  if (_events.isClosed) {
    throw WebSocketConnectionClosed();
  }
  _webSocket.add(b);
}