Interface IQuicConnection
- Namespace
- VpnHood.Net.Quic.Abstractions
- Assembly
- VpnHood.Net.Quic.Abstractions.dll
Represents an established QUIC connection, over which either side opens and accepts streams. VpnHood uses QUIC as a transport, so its streams are plain Stream objects.
public interface IQuicConnection : IAsyncDisposable
- Inherited Members
Remarks
The caller owns the connection and each stream it returns, and disposes them. Disposing the connection closes it, and disposes the streams the peer opened that nobody accepted.
Properties
LocalEndPoint
Gets the connection's local address and port.
IPEndPoint LocalEndPoint { get; }
Property Value
Remarks
The Android and iOS clients do not know it, and give the any address with port 0.
RemoteEndPoint
Gets the connection's remote address and port.
IPEndPoint RemoteEndPoint { get; }
Property Value
Methods
AcceptInboundStreamAsync(CancellationToken)
Accepts the next stream the peer opens: a bidirectional one, or on a server, also a unidirectional one, which only reads.
ValueTask<Stream> AcceptInboundStreamAsync(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenThe token to monitor for cancellation requests.
Returns
Exceptions
- OperationCanceledException
cancellationTokenwas canceled.- InvalidOperationException
The connection is closed, on the Android and iOS clients.
- IOException
The connection is closed, on MsQuic, or the stream could not start, on iOS.
OpenOutboundStreamAsync(CancellationToken)
Opens a bidirectional stream.
ValueTask<Stream> OpenOutboundStreamAsync(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenThe token to monitor for cancellation requests.
Returns
Remarks
MsQuic waits for the peer's stream allowance; the iOS client may fail at once instead.
Exceptions
- OperationCanceledException
cancellationTokenwas canceled.- IOException
The stream could not be opened, as when the connection is closed.
- ObjectDisposedException
The connection is disposed.