Table of Contents

Interface IQuicServerConnection

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

Represents a server's QUIC connection, with what an application protocol such as HTTP/3 needs beyond IQuicConnection. The streams it opens and accepts also implement IQuicStream.

public interface IQuicServerConnection : IQuicConnection, IAsyncDisposable
Inherited Members

Remarks

Disposing one of its streams synchronously starts the stream's close without waiting for it; MsQuic's DisposeAsync() waits for the close with a five-second deadline, and native cleanup may continue afterward.

Methods

CloseAsync(long, CancellationToken)

Closes the connection with an application error code, which the peer receives.

ValueTask CloseAsync(long errorCode, CancellationToken cancellationToken)

Parameters

errorCode long

The application protocol's error code; the transport does not interpret it.

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

ValueTask

A task that represents the asynchronous operation.

OpenOutboundUnidirectionalStreamAsync(CancellationToken)

Opens a write-only stream, waiting for the peer's stream allowance.

ValueTask<Stream> OpenOutboundUnidirectionalStreamAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

ValueTask<Stream>

A task whose result is the stream, which the caller owns and disposes.

Exceptions

OperationCanceledException

cancellationToken was canceled.

IOException

The stream could not be opened, as when the connection is closed.