Extensions
static class
Provides extension methods for PacketStreamWriter.
Declaration
public static class Extensions
| Namespace | McProtoNet.Transport.Framing |
| Assembly | McProtoNet.Transport.dll |
| Source | src/McProtoNet.Transport/Framing/Extensions.cs#L8 ↗ |
Methods
| Signature | Description |
|---|---|
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.