TransportConnection class abstract

An interface for transporting messages, define the methods necessary to send and receive messages, independently from the underlying transport mechanism.

Messages, not bytes

The transport has to keep the message boundaries: one send must reach the peer as exactly one event on its incoming. Every frame is decoded on its own, so a frame that arrives split in two, or glued to the next one, does not decode and is reported as undecodable instead of being buffered.

A WebSocket, an isolate port or an in-memory pipe give this for free. A raw TCP socket does not — it delivers whatever chunks it pleases, so it needs a framing layer of its own underneath.

Implementers

Constructors

TransportConnection()

Properties

hashCode → int
The hash code for this object.
no setterinherited
incoming → Stream<List<int>>
Stream of incoming data, one event per message sent by the peer.
no setter
isConnected → bool
Whether the connection is active
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

close() → Future<void>
Close the connection
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
send(List<int> data) → Future<void>
Send data as a single message.
toString() → String
A string representation of this object.
inherited

Operators

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