Перейти к основному содержимому

Extensions

static class

Provides extension methods for PacketStreamWriter.

Declaration​

public static class Extensions
NamespaceMcProtoNet.Transport.Framing
AssemblyMcProtoNet.Transport.dll
Sourcesrc/McProtoNet.Transport/Framing/Extensions.cs#L8 ↗

Methods​

SignatureDescription
static ValueTask WriteAndDisposeAsync(this PacketStreamWriter writer, OutgoingPacket packet, CancellationToken token = default)Asynchronously writes a packet and releases the buffer it owns.

WriteAndDisposeAsync(PacketStreamWriter, OutgoingPacket, CancellationToken)​

public static ValueTask WriteAndDisposeAsync(this PacketStreamWriter writer, OutgoingPacket packet, CancellationToken token = default)

Asynchronously writes a packet and releases the buffer it owns.

Parameters: writer (PacketStreamWriter), packet (OutgoingPacket), token (CancellationToken)

Returns: ValueTask - A task that represents the asynchronous write operation.

Exceptions: ObjectDisposedException - writer has already been disposed.; InvalidOperationException - Another write on writer is already in progress.; OperationCanceledException - The cancellation token was canceled. This exception is stored into the returned task.