HubLink class abstract interface

A message-oriented, ordered, reliable link carrying text and binary frames.

Frames arrive on stream as a String (control) or a List<int> (a sample frame), exactly as a WebSocket delivers them. close takes the same code and reason a WebSocket close does, and the far end reads them back from closeCode and closeReason once its stream is done — the hub's close codes (HubCloseCode) are how a client tells "wrong secret" from "the session is over", so a link that lost them would make every refusal look like a network drop.

Implementers

Properties

closeCode → int?
The code the far end closed with, once stream is done.
no setter
closeReason → String?
The reason the far end closed with, once stream is done.
no setter
hashCode → int
The hash code for this object.
no setterinherited
isOpen → bool
Whether add still goes anywhere.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
stream → Stream<Object?>
Inbound frames. Single-subscription; done when the link closes.
no setter

Methods

add(Object data) → void
Sends one frame: a String or a List<int>.
close([int? code, String? reason]) → Future<void>
Closes the link, telling the far end code and reason.
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

Static Methods

pair() → (HubLink, HubLink)
Two links joined back to back, in memory.