RelaySessionHost constructor
RelaySessionHost({
- RelayStore? store,
- RelayCompactionCoordinator? compaction,
- Compressor? compressor,
- MessageCodec<
Message> ? messageCodec, - int? maxBufferSize,
- List<
ServerSyncPlugin> ? plugins,
Relay session host: the server half of the relay protocol, with no transport of its own.
A relay 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 host serves many rooms, keyed by document id.
Feed it connections with SessionHostServer.acceptConnection. For a host
that owns its own dart:io socket, use WebSocketRelayServer instead.
A null messageCodec leaves each RelayClientSession to build the
relay codec itself.
Implementation
RelaySessionHost({
RelayStore? store,
RelayCompactionCoordinator? compaction,
super.compressor,
super.messageCodec,
super.maxBufferSize,
super.plugins,
}) : _store = store ?? InMemoryRelayStore(),
_compaction = compaction ?? RelayCompactionCoordinator();