Class IosQuicClient
- Namespace
- VpnHood.Net.Quic.Ios
- Assembly
- VpnHood.Net.Quic.Ios.dll
Provides the QUIC client for iOS, on Apple's Network.framework (iOS 15 or later): one multiplexed QUIC connection whose streams are opened and accepted as with the desktop MsQuic client.
public sealed class IosQuicClient : IQuicClient
- Inheritance
-
IosQuicClient
- Implements
- Inherited Members
Remarks
Network.framework does the TLS handshake and evaluates the system's trust; then CertificateValidationCallback decides. The callback gets the server's leaf certificate, no chain, and either no error or RemoteCertificateChainErrors when the system does not trust it; a callback that throws rejects the certificate. The client pins nothing itself.
Constructors
IosQuicClient(ulong?, ulong?, ulong?)
Provides the QUIC client for iOS, on Apple's Network.framework (iOS 15 or later): one multiplexed QUIC connection whose streams are opened and accepted as with the desktop MsQuic client.
public IosQuicClient(ulong? initialMaxStreamDataBidirectionalLocal = null, ulong? initialMaxStreamDataBidirectionalRemote = null, ulong? initialMaxData = null)
Parameters
initialMaxStreamDataBidirectionalLocalulong?The initial QUIC flow-control credit, in bytes, each stream this client opens advertises, or null for Network.framework's default.
initialMaxStreamDataBidirectionalRemoteulong?The initial QUIC flow-control credit, in bytes, each stream the server opens advertises, or null for Network.framework's default.
initialMaxDataulong?The initial QUIC flow-control credit, in bytes, the whole connection advertises, or null for Network.framework's default. Network.framework grants more credit as it buffers data, not as the app reads it, so these credits bound no memory. IosQuicClientFactory sets small ones.
Remarks
Network.framework does the TLS handshake and evaluates the system's trust; then CertificateValidationCallback decides. The callback gets the server's leaf certificate, no chain, and either no error or RemoteCertificateChainErrors when the system does not trust it; a callback that throws rejects the certificate. The client pins nothing itself.
Properties
IsSupported
Gets a value indicating whether Network.framework QUIC is supported: on iOS 15 or later. It is false on tvOS.
public static bool IsSupported { get; }
Property Value
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
optionsQuicClientConnectOptionsThe server's endpoint, the name it is reached by and the certificate check.
cancellationTokenCancellationTokenThe 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
cancellationTokenwas canceled.- IOException
The connection failed: the server could not be reached, refused it, or the certificate was rejected.
- OperationCanceledException
cancellationTokenwas canceled.- IOException
The connection failed: the endpoint could not be made, the server could not be reached, or the certificate was rejected.