HubCore class
A role-blind relay.
The hub holds a PeerRegistry and a RelayRouting table and nothing else. It does not know what a coordinator is, never inspects a coordination message, and never parses a data sample — election, membership and stream lifecycle all stay client-side, exactly as they are over LSL.
That is what keeps the relay cheap: a data frame costs one two-byte in-place write and a forward per subscriber.
Constructors
- HubCore({required HubCredentials credentials, WsLimits limits = const WsLimits(), Duration? sessionTtl})
-
A hub for the one session
credentialsnames.
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.
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 a server's WebSocket upgrade per connection and
cannot change under a live socket.
final
- pendingCount → int
-
Sockets that have connected but not yet authenticated.
no setter
- refusal → String?
-
Whether a new link would be refused, and if so why.
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
Methods
-
accept(
HubLink link) → bool - Takes a freshly opened link, challenges it, and waits — briefly — for it to authenticate.
-
close(
) → Future< void> - Closes every connection and drops all state.
-
endSession(
{String reason = 'session ended'}) → Future< void> - Ends the session: disconnects every peer and refuses new ones.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
openSession(
{required String secret, Duration? ttl}) → void - Reopens the hub as a new session generation.
-
revoke(
String nodeUId, {String reason = 'revoked'}) → Future< void> - Bars one node for the rest of this epoch, and disconnects it now.
-
subscribersFor(
{required String streamName, required String producerEndpointId}) → Set< String> -
The subscribers this hub would relay
producerEndpointId's stream to. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited