SolanaMobileWebSocket class

Solana Mobile Web Socket

Constructors

SolanaMobileWebSocket({int? maxAttempts, List<int>? backoffSchedule, Iterable<String>? protocols})
Manages a single web socket connection.

Properties

backoffSchedule List<int>
The default backoff schedule.
final
connectedAt DateTime?
no setter
hashCode int
The hash code for this object.
no setterinherited
isConnected bool
Returns true if the socket is open.
no setter
lock → Lock
Guards critical sections of the connection cycle (connect/disconnect).
final
maxAttempts int
The default maximum number of connection attempts per connect() call.
final
onConnect ↔ void Function(WebSocket socket)?
The callback function triggered when the socket connects.
getter/setter pair
protocols Iterable<String>?
The default subprotocols.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
socket WebSocket?
The underlying web socket.
getter/setter pair
state SolanaMobileWebSocketState
The web socket's current connection state.
no setter

Methods

backoff(int i, {required List<int> schedule}) FutureOr<void>
Returns a future that completes after schedule[i] milliseconds. If i is out of range, the future completes in schedule.last milliseconds or immediately when schedule is empty.
connect(Uri uri, {Duration? pingInterval, Iterable<String>? protocols, int? maxAttempts, List<int>? backoffSchedule, Duration? timeout, Duration? lockTimeout}) Future<WebSocket>
Creates a web socket connection to uri.
disconnect([int? code, String? reason]) Future<void>
Disconnects the web socket connection.
listen({void onConnect(WebSocket socket)?}) → void
Adds listeners to be called within the connect() and disconnect() synchronised execution blocks.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
send(dynamic data) → void
Sends data on the web socket connection.
sendJson(Map<String, dynamic> data) → void
Sends JSON data on the web socket connection.
toString() String
A string representation of this object.
inherited

Operators

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