WebSocketRelayServer class
WebSocket relay server implementation.
A relay server rebroadcasts opaque CRDT change blobs to the other clients of a room and persists them in a RelayStore, without ever interpreting CRDT data: merging is entirely a client concern. One server hosts many rooms, keyed by document id.
- Inheritance
-
- Object
- CRDTSocketServer
- WebSocketRelayServer
Constructors
-
WebSocketRelayServer({required Future<
HttpServer> serverFactory(), RelayStore? store, RelayCompactionCoordinator? compaction, Compressor? compressor, MessageCodec<Message> ? messageCodec, int? maxBufferSize, List<ServerSyncPlugin> ? plugins}) - WebSocket relay server implementation.
-
WebSocketRelayServer.test({required Future<
HttpServer> serverFactory(), WebSocketServerTransformer? serverTransformer, RelayStore? store, RelayCompactionCoordinator? compaction, Compressor? compressor, MessageCodec<Message> ? messageCodec, int? maxBufferSize, List<ServerSyncPlugin> ? plugins}) - WebSocket relay server implementation.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- host → String
-
The server host, if the server is not running, it will return
''no setter -
plugins
→ List<
ServerSyncPlugin> -
The server plugins
finalinherited
- port → int
-
The server port, if the server is not running, it will return
0no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
serverEvents
→ Stream<
ServerEvent> -
Server event stream
no setteroverride
- store → RelayStore
-
The room persistence used by this server.
no setter
Methods
-
broadcastMessage(
Message message, {List< String> ? excludeClientIds}) → Future<void> -
Broadcast a message to all subscribed clients
override
-
dispose(
) → Future< void> -
Dispose the server
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
sendMessageToClient(
String clientId, Message message) → Future< void> -
Send a message to a specific client
override
-
start(
) → Future< bool> -
Start the server
override
-
stop(
) → Future< void> -
Stop the server
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited