Table of Contents

Interface IQuicStream

Namespace
VpnHood.Net.Quic.Abstractions
Assembly
VpnHood.Net.Quic.Abstractions.dll

Represents the QUIC controls of a server's stream, beside its ordinary Stream operations. The application protocol chooses its error codes; the transport does not interpret them.

public interface IQuicStream

Properties

CanRead

Gets a value indicating whether the stream has an inbound direction.

bool CanRead { get; }

Property Value

bool

CanWrite

Gets a value indicating whether the stream has an outbound direction.

bool CanWrite { get; }

Property Value

bool

ReadsClosed

Gets a task that completes when the inbound direction closes: when the peer's FIN is read, or the direction is aborted.

Task ReadsClosed { get; }

Property Value

Task

StreamId

Gets the stream's QUIC stream ID, whose low two bits tell who opened it and whether it is bidirectional (RFC 9000, section 2.1).

long StreamId { get; }

Property Value

long

WritesClosed

Gets a task that completes when the outbound direction closes: when the peer acknowledges the FIN, or the direction is aborted.

Task WritesClosed { get; }

Property Value

Task

Methods

AbortRead(long)

Stops receiving data and sends the peer an application error code.

void AbortRead(long errorCode)

Parameters

errorCode long

The application protocol's error code.

AbortWrite(long)

Stops sending data and sends the peer an application error code.

void AbortWrite(long errorCode)

Parameters

errorCode long

The application protocol's error code.

CompleteWrites()

Sends FIN after the pending writes, without closing the inbound direction.

void CompleteWrites()

WriteFinal(ReadOnlyMemory<byte>, CancellationToken)

Writes the final bytes and FIN together.

ValueTask WriteFinal(ReadOnlyMemory<byte> buffer, CancellationToken cancellationToken)

Parameters

buffer ReadOnlyMemory<byte>

The bytes. The caller keeps them unchanged until the returned task completes, also after cancellation.

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

ValueTask

A task that represents the asynchronous operation.