WebSocketClient class

CRDTSocketClient implementation using web socket

Inheritance

Constructors

WebSocketClient({required String url, required CRDTDocument document, required PeerId author, Compressor? compressor, MessageCodec<Message>? messageCodec, Duration? pingInterval, Duration? pingTimeout, int? maxBufferSize, List<ClientSyncPlugin>? plugins, DocumentCapabilities? capabilities})
Constructor
WebSocketClient.test({required String url, required CRDTDocument document, required PeerId author, required Transport transportFactory(), Compressor? compressor, MessageCodec<Message>? messageCodec, Duration? pingInterval, Duration? pingTimeout, int? maxBufferSize, List<ClientSyncPlugin>? plugins, DocumentCapabilities? capabilities})
Constructor for testing

Properties

author → PeerId
Author of the document
final
capabilities → DocumentCapabilities
What this build tells the server it can read.
no setterinherited
connectionStatus → Stream<ConnectionStatus>
Stream of connection status changes between client and server.
no setterinherited
connectionStatusValue → ConnectionStatus
The current connection status. ConnectionStatus.disconnected until the first move.
no setterinherited
document → CRDTDocument
The local CRDT document
final
faults → Stream<SyncFault>
What the client could not do with something the server sent.
no setterinherited
handshake → HandshakeGate
The handshake of the current connection attempt.
finalinherited
hashCode → int
The hash code for this object.
no setterinherited
incompatibility → SyncIncompatibility?
Why the server refused this build, or null while it has not.
no setterinherited
isUnsupported → bool
Whether the server has refused this build.
no setterinherited
lastFault → SyncFault?
The last fault, or null while there has been none.
no setterinherited
messages → Stream<Message>
Stream of incoming server messages
no setteroverride
plugins → List<ClientSyncPlugin>
The client plugins
finalinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
sessionId → String?
The session ID
no setteroverride
statedCapabilities → SyncCapabilities?
capabilities as the peer states them, or null when they claim nothing.
no setterinherited
url → String
WebSocket server URL
final

Methods

closeClientStreams() → void
Ends faults and connectionStatus. Call it from dispose.
inherited
connect() → Future<bool>
Connect to the server
override
disconnect() → Future<void>
Disconnect the client from the server
override
dispose() → void
Dispose the client
override
handleErrorMessage(ErrorMessage message) → void
Acts on an ErrorMessage the peer sent, for the codes every client answers the same way.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
refuseBuild({required String code, required String reason}) → void
The server refused this build: stop for good.
inherited
refuseServerProtocolMismatch(int serverVersion) → bool
Refuses a server that speaks another Protocol.protocolVersion, and says whether it did.
inherited
reportSyncFault(SyncFault fault) → void
Reports fault on faults and latches it on lastFault.
inherited
requestSync() → Future<void>
Request a sync message from the server
override
sendChange(Change change) → Future<void>
Send a Change to the server
override
sendMessage(Message message, {bool attemptReconnect = true}) → Future<void>
Send a message to the server
override
toString() → String
A string representation of this object.
inherited
updateConnectionStatus(ConnectionStatus status) → void
Moves the client to status, and publishes it when it is a move.
inherited

Operators

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