WsControl enum

Control-frame types.

Control traffic is JSON text; data samples use the binary frame below.

Inheritance
Available extensions

Values

challenge → const WsControl

hub -> client: a single-use nonce, sent the instant the socket opens.

The first frame of every connection. The client answers with auth; the hub honours nothing else until it has.

auth → const WsControl

client -> hub: proof of the shared secret, answering a challenge.

Carries session, epoch, nodeUId and proof. The secret itself never travels — proof is an HMAC over the nonce, so the handshake is safe even on plain ws:// and a captured proof cannot be replayed on another connection or in another session epoch.

authOk → const WsControl

hub -> client: authenticated. Only now do other frames mean anything.

hello → const WsControl

client -> hub: "here is who I am". Carries a PeerDescriptor.

welcome → const WsControl

hub -> client: assigns a connection id and a numeric slot.

update → const WsControl

client -> hub: republish my descriptor (role changed after election).

query → const WsControl

client -> hub: run a DiscoveryQuery, optionally continuously.

queryResult → const WsControl

hub -> client: peers matching a query.

unquery → const WsControl

client -> hub: stop a continuous query.

subscribe → const WsControl

client -> hub: deliver this producer's stream to me.

unsubscribe → const WsControl

client -> hub: stop delivering this producer's stream to me.

The counterpart to subscribe, added with NetworkStream.removeInlet. Without it a route outlives the inlet that asked for it, and the hub keeps relaying to a stream that has already let go of the peer — until the producer's socket closes, which may be much later or never.

message → const WsControl

client -> hub -> subscribers: a coordination message (JSON payload).

peerGone → const WsControl

hub -> client: a peer this client cared about has gone.

signal → const WsControl

client -> hub -> one named client: an opaque payload, forwarded verbatim.

The hub's only unicast, and the only frame whose contents it never looks at. It exists so a peer-to-peer transport can use this hub for discovery and connection setup — WebRTC offer/answer/candidate exchange — while its data never touches the hub at all. Establishing that path cannot itself run over the coordination stream, because the coordination stream is what is being established.

The hub verifies only that the sender owns the from endpoint, exactly as it does for message. What is inside payload is between the two peers.

Properties

hashCode → int
The hash code for this object.
no setterinherited
index → int
A numeric identifier for the enumerated value.
no setterinherited
name → String

Available on Enum, provided by the EnumName extension

The name of the enum value.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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

Constants

values → const List<WsControl>
A constant List of the values in this enum, in order of their declaration.