Table of Contents

Class MsQuicClient

Namespace
VpnHood.Net.Quic.MsQuic
Assembly
VpnHood.Net.Quic.MsQuic.dll

Represents a QUIC client on MsQuic, through .NET's QuicConnection, for Windows and Linux.

public sealed class MsQuicClient : IQuicClient
Inheritance
MsQuicClient
Implements
Inherited Members

Remarks

Its connections use TLS 1.3 only, the "h3" ALPN token and no certificate revocation check, and abort streams and close with error code 0 unless told otherwise.

Properties

IsSupported

Gets a value indicating whether MsQuic connections are supported on this platform.

public static bool IsSupported { get; }

Property Value

bool

Methods

ConnectAsync(QuicClientConnectOptions, CancellationToken)

Opens a QUIC connection to a server and completes its TLS handshake.

public ValueTask<IQuicConnection> ConnectAsync(QuicClientConnectOptions options, CancellationToken cancellationToken)

Parameters

options QuicClientConnectOptions

The server's endpoint, the name it is reached by and the certificate check.

cancellationToken CancellationToken

The token to monitor for cancellation requests.

Returns

ValueTask<IQuicConnection>

A task that represents the asynchronous operation. Its result is the connection; dispose it to close it.

Exceptions

NotSupportedException

The platform does not support this client's QUIC.

OperationCanceledException

cancellationToken was canceled.

IOException

The connection failed: the server could not be reached, refused it, or the certificate was rejected.