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
errorCodelongThe application protocol's error code; the transport does not interpret it.
cancellationTokenCancellationTokenThe 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
cancellationTokenCancellationTokenThe token to monitor for cancellation requests.
Returns
Exceptions
- OperationCanceledException
cancellationTokenwas canceled.- IOException
The stream could not be opened, as when the connection is closed.