Class JsonRpcMessagePackChannel
- Namespace
- Nerdbank.JsonRpc
- Assembly
- Nerdbank.JsonRpc.dll
Encodes JSON-RPC messages as MessagePack over a duplex pipe, framed as described by JsonRpcMessagePackFraming. Inbound frames are limited by MaximumMessageSize.
public class JsonRpcMessagePackChannel : JsonRpcPipeChannel, IAsyncDisposable
- Inheritance
-
JsonRpcMessagePackChannel
- Implements
- Inherited Members
Constructors
JsonRpcMessagePackChannel(IDuplexPipe, MessagePackSerializer, JsonRpcMessagePackFraming, int?, int?)
Initializes a new instance of the JsonRpcMessagePackChannel class with a configured serializer and framing.
public JsonRpcMessagePackChannel(IDuplexPipe pipe, MessagePackSerializer serializer, JsonRpcMessagePackFraming framing, int? inboundCapacity = 100, int? outboundCapacity = null)
Parameters
pipeIDuplexPipeThe connected duplex pipe.
serializerMessagePackSerializerThe serializer for MessagePack application values and envelopes.
framingJsonRpcMessagePackFramingThe wire framing convention, which both parties must agree on.
inboundCapacityint?The inbound queue limit, or null for an unbounded queue.
outboundCapacityint?The outbound queue limit, or null for an unbounded queue.
JsonRpcMessagePackChannel(IDuplexPipe, MessagePackSerializer, int?, int?)
Initializes a new instance of the JsonRpcMessagePackChannel class with a configured serializer.
public JsonRpcMessagePackChannel(IDuplexPipe pipe, MessagePackSerializer serializer, int? inboundCapacity = 100, int? outboundCapacity = null)
Parameters
pipeIDuplexPipeThe connected duplex pipe.
serializerMessagePackSerializerThe serializer for MessagePack application values and envelopes.
inboundCapacityint?The inbound queue limit, or null for an unbounded queue.
outboundCapacityint?The outbound queue limit, or null for an unbounded queue.
JsonRpcMessagePackChannel(IDuplexPipe, int?, int?)
Initializes a new instance of the JsonRpcMessagePackChannel class with the default serializer.
public JsonRpcMessagePackChannel(IDuplexPipe pipe, int? inboundCapacity = 100, int? outboundCapacity = null)
Parameters
pipeIDuplexPipeThe connected duplex pipe.
inboundCapacityint?The inbound queue limit, or null for an unbounded queue.
outboundCapacityint?The outbound queue limit, or null for an unbounded queue.
Fields
DefaultFraming
The framing used when none is specified.
public const JsonRpcMessagePackFraming DefaultFraming = BigEndianInt32LengthHeader
Field Value
Properties
DefaultSerializer
Gets the default serializer for MessagePack channels.
public static MessagePackSerializer DefaultSerializer { get; }
Property Value
Encoding
Gets the encoding used by this transport.
public override JsonRpcEncoding Encoding { get; }
Property Value
Serializer
Gets the serializer selected by this channel for application values.
public override JsonRpcSerializer Serializer { get; }
Property Value
Methods
ReceiveMessagesAsync(PipeReader, CancellationToken)
protected override IAsyncEnumerable<JsonRpcMessage> ReceiveMessagesAsync(PipeReader reader, CancellationToken cancellationToken)
Parameters
readerPipeReadercancellationTokenCancellationToken
Returns
SendMessageAsync(PipeWriter, JsonRpcMessage, CancellationToken)
protected override ValueTask SendMessageAsync(PipeWriter writer, JsonRpcMessage message, CancellationToken cancellationToken)
Parameters
writerPipeWritermessageJsonRpcMessagecancellationTokenCancellationToken