CoordinationHub class

A HubCore behind an HTTP server that upgrades to WebSockets.

Everything a hub decides — admission, identity binding, routing, limits — is in HubCore. This class owns only the listening socket, the upgrade (with its frame-size cap and optional byte metering) and keepalive pings.

Properties

connectionCount → int
Number of authenticated clients.
no setter
endpointCount → int
Number of registered endpoints across all clients.
no setter
epoch → int
The current session generation. See HubCore.epoch.
no setter
hashCode → int
The hash code for this object.
no setterinherited
limits → WsLimits
Resource limits. Fixed for the hub's lifetime — WsLimits.maxFrameBytes in particular is handed to the WebSocket upgrade per connection and cannot change under a live socket.
no setter
pendingCount → int
Sockets that have connected but not yet authenticated.
no setter
port → int
The port the hub is listening on.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
sessionName → String
The one session this hub hosts.
no setter
status → HubSessionStatus
no setter
uri → Uri
Where clients should point a WebSocketTransportConfig.
no setter

Methods

close() → Future<void>
Stops the hub and closes every connection.
endSession({String reason = 'session ended'}) → Future<void>
See HubCore.endSession.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
openSession({required String secret, Duration? ttl}) → void
See HubCore.openSession.
revoke(String nodeUId, {String reason = 'revoked'}) → Future<void>
See HubCore.revoke.
subscribersFor({required String streamName, required String producerEndpointId}) → Set<String>
See HubCore.subscribersFor.
toString() → String
A string representation of this object.
inherited

Operators

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

Static Methods

serve({required HubCredentials credentials, InternetAddress? address, int port = 0, WsLimits limits = const WsLimits(), Duration? sessionTtl}) → Future<CoordinationHub>
Starts a hub for one session.