Share via


MessagePackFormatter Class

Definition

Serializes JSON-RPC messages using MessagePack (a fast, compact binary format).

public class MessagePackFormatter : IDisposable, StreamJsonRpc.IJsonRpcInstanceContainer, StreamJsonRpc.IJsonRpcMessageFormatter, StreamJsonRpc.Reflection.IJsonRpcFormatterState, StreamJsonRpc.Reflection.IJsonRpcFormatterTracingCallbacks
public class MessagePackFormatter : IDisposable, StreamJsonRpc.IJsonRpcInstanceContainer, StreamJsonRpc.IJsonRpcMessageFactory, StreamJsonRpc.IJsonRpcMessageFormatter, StreamJsonRpc.Reflection.IJsonRpcFormatterState, StreamJsonRpc.Reflection.IJsonRpcFormatterTracingCallbacks
type MessagePackFormatter = class
    interface IJsonRpcMessageFormatter
    interface IJsonRpcInstanceContainer
    interface IJsonRpcFormatterState
    interface IJsonRpcFormatterTracingCallbacks
    interface IDisposable
type MessagePackFormatter = class
    interface IJsonRpcMessageFormatter
    interface IJsonRpcInstanceContainer
    interface IJsonRpcFormatterState
    interface IJsonRpcFormatterTracingCallbacks
    interface IJsonRpcMessageFactory
    interface IDisposable
Public Class MessagePackFormatter
Implements IDisposable, IJsonRpcFormatterState, IJsonRpcFormatterTracingCallbacks, IJsonRpcInstanceContainer, IJsonRpcMessageFormatter
Public Class MessagePackFormatter
Implements IDisposable, IJsonRpcFormatterState, IJsonRpcFormatterTracingCallbacks, IJsonRpcInstanceContainer, IJsonRpcMessageFactory, IJsonRpcMessageFormatter
Inheritance
MessagePackFormatter
Implements

Remarks

The MessagePack implementation used here comes from https://github.com/neuecc/MessagePack-CSharp. The README on that project site describes use cases and its performance compared to alternative .NET MessagePack implementations and this one appears to be the best by far.

Constructors

MessagePackFormatter()

Initializes a new instance of the MessagePackFormatter class.

Properties

DefaultUserDataSerializationOptions

Gets the default MessagePack.MessagePackSerializerOptions used for user data (arguments, return values and errors) in RPC calls prior to any call to SetMessagePackSerializerOptions(MessagePackSerializerOptions).

MultiplexingStream

Gets or sets the MultiplexingStream that may be used to establish out of band communication (e.g. marshal IDuplexPipe arguments).

Methods

Deserialize(ReadOnlySequence<Byte>)

Deserializes a JsonRpcMessage.

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Dispose(Boolean)

Disposes managed and native resources held by this instance.

GetJsonText(JsonRpcMessage)

Gets a JSON representation for a given message for tracing purposes.

Serialize(IBufferWriter<Byte>, JsonRpcMessage)

Serializes a JsonRpcMessage.

SetMessagePackSerializerOptions(MessagePackSerializerOptions)

Sets the MessagePack.MessagePackSerializerOptions to use for serialization of user data.

Explicit Interface Implementations

IJsonRpcFormatterState.DeserializingMessageWithId

Gets the ID of the response currently being deserialized.

IJsonRpcFormatterState.SerializingMessageWithId

Gets the id of the request or response currently being serialized.

IJsonRpcFormatterState.SerializingRequest

Gets a value indicating whether a JsonRpcRequest is being serialized.

IJsonRpcFormatterTracingCallbacks.OnSerializationComplete(JsonRpcMessage, ReadOnlySequence<Byte>)
IJsonRpcInstanceContainer.Rpc

Sets the JsonRpc instance.

IJsonRpcMessageFactory.CreateErrorMessage()

Creates an instance of JsonRpcError suitable for transmission over the IJsonRpcMessageFormatter.

IJsonRpcMessageFactory.CreateRequestMessage()

Creates an instance of JsonRpcRequest suitable for transmission over the IJsonRpcMessageFormatter.

IJsonRpcMessageFactory.CreateResultMessage()

Creates an instance of JsonRpcResult suitable for transmission over the IJsonRpcMessageFormatter.

Applies to