Share via


LengthHeaderMessageHandler Class

Definition

A minimal header for each message that simply declares content length.

public class LengthHeaderMessageHandler : StreamJsonRpc.PipeMessageHandler
type LengthHeaderMessageHandler = class
    inherit PipeMessageHandler
Public Class LengthHeaderMessageHandler
Inherits PipeMessageHandler
Inheritance
LengthHeaderMessageHandler

Remarks

The length is expressed as a big endian, 4 byte integer.

Constructors

LengthHeaderMessageHandler(IDuplexPipe, IJsonRpcMessageFormatter)

Initializes a new instance of the LengthHeaderMessageHandler class.

LengthHeaderMessageHandler(PipeWriter, PipeReader, IJsonRpcMessageFormatter)

Initializes a new instance of the LengthHeaderMessageHandler class.

LengthHeaderMessageHandler(Stream, Stream, IJsonRpcMessageFormatter)

Initializes a new instance of the LengthHeaderMessageHandler class.

Properties

CanRead

Gets a value indicating whether this message handler can receive messages.

(Inherited from PipeMessageHandler)
CanWrite

Gets a value indicating whether this message handler can send messages.

(Inherited from PipeMessageHandler)
DisposalToken

Gets a token that is canceled when this instance is disposed.

(Inherited from MessageHandlerBase)
Formatter

Gets the formatter used for message serialization.

(Inherited from MessageHandlerBase)
Reader

Gets the reader to use for receiving messages.

(Inherited from PipeMessageHandler)
Writer

Gets the writer to use for transmitting messages.

(Inherited from PipeMessageHandler)

Methods

Dispose()
Obsolete.

Disposes this instance, and cancels any pending read or write operations.

(Inherited from MessageHandlerBase)
Dispose(Boolean)

Disposes resources allocated by this instance that are common to both reading and writing.

(Inherited from PipeMessageHandler)
DisposeAsync()

Disposes this instance, and cancels any pending read or write operations.

(Inherited from MessageHandlerBase)
DisposeReader()

Disposes resources allocated by this instance that are used for reading (not writing).

(Inherited from PipeMessageHandler)
DisposeWriter()

Disposes resources allocated by this instance that are used for writing (not reading).

(Inherited from PipeMessageHandler)
FlushAsync(CancellationToken)

Ensures that all messages transmitted up to this point are en route to their destination, rather than sitting in some local buffer.

(Inherited from PipeMessageHandler)
ReadAsync(CancellationToken)

Reads a distinct and complete message from the transport, waiting for one if necessary.

(Inherited from MessageHandlerBase)
ReadAtLeastAsync(Int32, Boolean, CancellationToken)

Reads from the Reader until at least a specified number of bytes are available.

(Inherited from PipeMessageHandler)
ReadCoreAsync(CancellationToken)

Reads a distinct and complete message, waiting for one if necessary.

Write(JsonRpcMessage, CancellationToken)

Writes a message to the pipe.

WriteAsync(JsonRpcMessage, CancellationToken)

Writes a message to the transport and flushes.

(Inherited from MessageHandlerBase)
WriteCoreAsync(JsonRpcMessage, CancellationToken)

Writes a message.

(Inherited from PipeMessageHandler)

Explicit Interface Implementations

IDisposableObservable.IsDisposed

Gets a value indicating whether this instance has been disposed.

(Inherited from MessageHandlerBase)
IJsonRpcMessageBufferManager.DeserializationComplete(JsonRpcMessage)

Notifies that it is safe to free buffers held to deserialize the payload for a message because all deserialization attempts are completed.

(Inherited from PipeMessageHandler)

Applies to