Skip to content

Interface IRpcChannel

Namespace: DotBoxD.Services.Transport
Assembly: DotBoxD.Services.dll

A duplex, framed, bidirectional channel — the transport unit a DotBoxD.Services.Peer.RpcPeer runs on. Responses flow back over the same channel, so it is always bidirectional even when the call direction is one-way. Transports return this directly; implement it to add a custom transport.

public interface IRpcChannel : IAsyncDisposable

IAsyncDisposable

Gets whether the channel is currently connected.

bool IsConnected { get; }

bool

Gets a string representation of the remote endpoint.

string RemoteEndpoint { get; }

string

Receives a framed message. The caller owns the returned DotBoxD.Services.Buffers.Payload and must dispose it. A payload with DotBoxD.Services.Buffers.Payload.Length of 0 signals the channel was closed.

Task<Payload> ReceiveAsync(CancellationToken ct = default)

ct CancellationToken

Task<Payload>

SendAsync(ReadOnlyMemory<byte>, CancellationToken)

Section titled “ SendAsync(ReadOnlyMemory<byte>, CancellationToken)”

Sends a framed message over the channel.

Task SendAsync(ReadOnlyMemory<byte> data, CancellationToken ct = default)

data ReadOnlyMemory<byte>

ct CancellationToken

Task