C# Class Lawo.EmberPlusSharp.S101.MessageEncodingStream

Transparently encodes a single message.

At construction, the passed message is first appended to the WriteBuffer object passed to CreateAsync. Afterwards, when data is written to this stream then it is first encoded and the encoded form is then appended to the WriteBuffer object.

Caution: DisposeAsync must be called in the end.

If necessary, the message plus payload is automatically partitioned into multiple packets such that the unencoded length of each packet does not exceed 1024 bytes.

Inheritance: NonSeekableStream
Afficher le fichier Open project: Lawo/ember-plus-sharp Class Usage Examples

Méthodes publiques

Méthode Description
DisposeAsync ( CancellationToken cancellationToken ) : Task
FlushAsync ( CancellationToken cancellationToken ) : Task
WriteAsync ( byte buffer, int offset, int count, CancellationToken cancellationToken ) : Task

Private Methods

Méthode Description
CreateAsync ( WriteBuffer rawBuffer, S101Message message, CancellationToken cancellationToken ) : Task
CreateFramingStream ( PacketFlags packetFlags, CancellationToken cancellationToken ) : Task
DisposeAndCreateFramingStreamAsync ( PacketFlags packetFlags, CancellationToken cancellationToken ) : Task
DisposeFramingStream ( CancellationToken cancellationToken ) : Task
MessageEncodingStream ( S101Message message, WriteBuffer rawBuffer, FramingStream framingStream ) : System
WriteOutOfFrameByteAsync ( byte value, CancellationToken cancellationToken ) : Task
WriteUnframedAsync ( byte buffer, int offset, int count, CancellationToken cancellationToken ) : Task

Method Details

DisposeAsync() public final méthode

public final DisposeAsync ( CancellationToken cancellationToken ) : Task
cancellationToken System.Threading.CancellationToken
Résultat Task

FlushAsync() public final méthode

public final FlushAsync ( CancellationToken cancellationToken ) : Task
cancellationToken System.Threading.CancellationToken
Résultat Task

WriteAsync() public final méthode

public final WriteAsync ( byte buffer, int offset, int count, CancellationToken cancellationToken ) : Task
buffer byte
offset int
count int
cancellationToken System.Threading.CancellationToken
Résultat Task