RelicWebSocket class abstract interface

An relic specific interface for bi-directional communication over web-sockets.

Properties

events Stream<WebSocketEvent>
A Stream of WebSocketEvent received from the peer.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
isClosed bool
Whether the web-socket is closed.
no setter
pingInterval Duration?
The interval at which ping frames are sent to keep the web-socket connection alive.
getter/setter pair
protocol String
The WebSocket subprotocol negotiated with the peer.
no setterinherited
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.
inherited
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.
inherited
sendText(String s) → void
Sends text data to the connected peer.
inherited
toString() String
A string representation of this object.
inherited
tryClose([int? code, String? reason]) Future<bool>
Try to close the WebSocket connection and the events Stream.
trySendBytes(Uint8List b) bool
Sends binary data to the peer, unless connection is already closed (either through close or by the peer). Returns false if connection is known to be closed, otherwise true.
trySendText(String s) bool
Sends text data to the peer, unless connection is already closed (either through close or by the peer). Returns false if connection is known to be closed, otherwise true.

Operators

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