RpcFrameMultiplexedChannel class
IRpcMultiplexedChannel that wraps a raw IRpcChannel with frame encoding.
Encodes outgoing RpcTransportMessage into RpcChannelFrame bytes and decodes incoming bytes back into messages. Handles partial-frame reassembly via an internal read buffer.
Use pair for testing without a real byte transport.
- Inheritance
-
- Object
- IRpcMultiplexedChannel
- RpcFrameMultiplexedChannel
Constructors
- RpcFrameMultiplexedChannel({required IRpcChannel channel, required bool isClient, RpcSecurityPolicy policy = const RpcSecurityPolicy(), bool? closeOnOversizedFrame, Duration? prefaceTimeout})
-
Creates a multiplexed channel that encodes/decodes frames over
channel.
Properties
- closeOnOversizedFrame → bool
-
Whether an oversized inbound frame kills the connection. Defaults to
!isClient.final -
discardedFrames
→ Stream<
({int bytes, int streamId})> -
Reports skipped bytes as they ARRIVE.
no setteroverride
- hashCode → int
-
The hash code for this object.
no setterinherited
-
incoming
→ Stream<
RpcTransportMessage> -
Incoming messages from all streams, already decoded.
no setteroverride
- isClient → bool
-
Whether this end opened the connection.
final
- isClosed → bool
-
Whether the channel has been closed.
no setteroverride
- peakReassemblyBytes → int
-
The largest the reassembly buffer has ever been grown to, in bytes — for
diagnostics and tests.
no setter
-
ready
→ Future<
void> -
Completes once the peer's preface has arrived and matched.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- supportsZeroCopy → bool
-
Whether the channel supports zero-copy message passing.
no setteroverride
Methods
-
close(
) → Future< void> -
Close the channel and release resources.
override
-
closeFor(
RpcChannelCloseReason reason) → Future< void> -
Forwarded to the byte channel, so layers ABOVE this channel can report a
peer fault too.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
send(
RpcTransportMessage message) → Future< void> -
Send a message to the remote side.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
pair(
{RpcSecurityPolicy policy = const RpcSecurityPolicy()}) → (RpcFrameMultiplexedChannel, RpcFrameMultiplexedChannel) - Creates a paired client/server frame channel over in-memory byte streams.