HandshakeChannel class
A ControlMessage-typed view over omnyhub's HandshakeConnection.
The handshake runs on the raw connection before the node control protocol
starts, so it cannot use a TypedConnection (that would consume the single
subscription omnyhub needs afterwards). HandshakeConnection solves exactly
this: it buffers what the handshake does not read and replays it, so both
sides can pull messages here and hand the connection on intact.
Constructors
- HandshakeChannel(HandshakeConnection connection, {ControlMessageCodec codec = ControlMessageCodec.instance})
-
Wraps
connection.const
Properties
- codec → ControlMessageCodec
-
The codec applied at the boundary.
final
- connection → HandshakeConnection
-
The underlying connection.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
expect<
T extends ControlMessage> ({Duration timeout = const Duration(seconds: 10)}) → Future< T> -
Reads the next message, requiring it to be a
T. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
receive(
{Duration timeout = const Duration(seconds: 10)}) → Future< ControlMessage> -
Reads the next message, failing if none arrives within
timeout. -
send(
ControlMessage message) → void -
Sends
message. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited