CupertinoWebSocket class

A WebSocket implemented using the NSURLSessionWebSocketTask API.

NOTE: the WebSocket interface is currently experimental and may change in the future.

Properties

events Stream<WebSocketEvent>
A Stream of WebSocketEvent received from the peer.
no setter
hashCode int
The hash code for this object.
no setterinherited
protocol String
The WebSocket subprotocol negotiated with the peer.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

close([int? code, String? reason]) Future<void>
Closes the WebSocket connection and the events Stream.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
sendBytes(Uint8List b) → void
Sends binary data to the connected peer.
sendText(String s) → void
Sends text data to the connected peer.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

connect(Uri url, {Iterable<String>? protocols, URLSessionConfiguration? config}) Future<CupertinoWebSocket>
Create a new WebSocket connection using the NSURLSessionWebSocketTask API.