Share via


DelimitedMessageHandler Class

Definition

An abstract base class for for sending and receiving distinct string messages over a channel that provides no natural boundaries and no built-in character encoding.

public abstract class DelimitedMessageHandler : IDisposable, Microsoft.IDisposableObservable
type DelimitedMessageHandler = class
    interface IDisposableObservable
    interface IDisposable
Public MustInherit Class DelimitedMessageHandler
Implements IDisposable, IDisposableObservable
Inheritance
DelimitedMessageHandler
Derived
Implements

Remarks

This class and its derivates are safe to call from any thread. Read and write requests are protected by a semaphore to guarantee message integrity and may be made from any thread.

Constructors

DelimitedMessageHandler(Stream, Stream, Encoding)

Initializes a new instance of the DelimitedMessageHandler class.

Properties

CanRead

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

CanWrite

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

DisposalToken

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

Encoding

Gets or sets the encoding to use for transmitted messages.

ReceivingStream

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

SendingStream

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

Methods

Dispose()

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

Dispose(Boolean)

Disposes resources allocated by this instance.

FlushCoreAsync()

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

ReadAsync(CancellationToken)

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

ReadCoreAsync(CancellationToken)

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

WriteAsync(String, CancellationToken)

Writes a message to the stream.

WriteCoreAsync(String, Encoding, CancellationToken)

Writes a message to the stream.

Explicit Interface Implementations

IDisposableObservable.IsDisposed

Gets a value indicating whether this instance has been disposed.

Applies to