HeaderDelimitedMessageHandler Class

Definition

Adds headers before each text message transmitted over a stream.

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

Remarks

This is based on the language server protocol spec: https://github.com/Microsoft/language-server-protocol/blob/master/protocol.md#base-protocol.

Constructors

HeaderDelimitedMessageHandler(IDuplexPipe, IJsonRpcMessageFormatter)

Initializes a new instance of the HeaderDelimitedMessageHandler class.

HeaderDelimitedMessageHandler(PipeWriter, PipeReader, IJsonRpcMessageFormatter)

Initializes a new instance of the HeaderDelimitedMessageHandler class.

HeaderDelimitedMessageHandler(Stream)

Initializes a new instance of the HeaderDelimitedMessageHandler class.

HeaderDelimitedMessageHandler(Stream, IJsonRpcMessageFormatter)

Initializes a new instance of the HeaderDelimitedMessageHandler class.

HeaderDelimitedMessageHandler(Stream, Stream)

Initializes a new instance of the HeaderDelimitedMessageHandler class.

HeaderDelimitedMessageHandler(Stream, Stream, IJsonRpcMessageFormatter)

Initializes a new instance of the HeaderDelimitedMessageHandler class.

Properties

CanRead

Gets a value indicating whether this message handler has a receiving stream.

(Inherited from DelimitedMessageHandler)
CanRead

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

(Inherited from PipeMessageHandler)
CanWrite

Gets a value indicating whether this message handler has a sending stream.

(Inherited from DelimitedMessageHandler)
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 DelimitedMessageHandler)
DisposalToken

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

(Inherited from MessageHandlerBase)
Encoding

Gets or sets the encoding to use for transmitted messages.

Encoding

Gets or sets the encoding to use for transmitted messages.

(Inherited from DelimitedMessageHandler)
Formatter

Gets the formatter used for message serialization.

(Inherited from MessageHandlerBase)
Reader

Gets the reader to use for receiving messages.

(Inherited from PipeMessageHandler)
ReceivingStream

Gets the stream used to receive messages. May be null.

(Inherited from DelimitedMessageHandler)
SendingStream

Gets the stream used to transmit messages. May be null.

(Inherited from DelimitedMessageHandler)
SubType

Gets or sets the value to use as the subtype in the Content-Type header (e.g. "application/SUBTYPE").

Writer

Gets the writer to use for transmitting messages.

(Inherited from PipeMessageHandler)

Methods

Dispose()

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

(Inherited from DelimitedMessageHandler)
Dispose()
Obsolete.

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

(Inherited from MessageHandlerBase)
Dispose(Boolean)

Disposes resources allocated by this instance.

(Inherited from DelimitedMessageHandler)
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)
FlushCoreAsync()

Calls FlushAsync() on the SendingStream, or equivalent sending stream if using an alternate transport.

(Inherited from DelimitedMessageHandler)
ReadAsync(CancellationToken)

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

(Inherited from DelimitedMessageHandler)
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)
WriteAsync(String, CancellationToken)

Writes a message to the stream.

(Inherited from DelimitedMessageHandler)
WriteCoreAsync(JsonRpcMessage, CancellationToken)

Writes a message.

(Inherited from PipeMessageHandler)
WriteCoreAsync(String, Encoding, CancellationToken)

Writes a message to the stream.

Explicit Interface Implementations

IDisposableObservable.IsDisposed (Inherited from DelimitedMessageHandler)
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