MsQuicListener Class
Listens for QUIC connections.
public sealed class MsQuicListener : IAsyncDisposable- Implements
Properties
| Name | Description |
|---|---|
| IsSupported | Gets a value indicating whether MsQuic is available, see MsQuicLibrary. |
| LocalEndPoint | Gets the address the listener listens on, with the port it picked when the options set port 0. |
IsSupported
MsQuicListener.csGets a value indicating whether MsQuic is available, see MsQuicLibrary.
public static bool IsSupported { get; }Property value
LocalEndPoint
MsQuicListener.csGets the address the listener listens on, with the port it picked when the options set port 0.
public IPEndPoint LocalEndPoint { get; }Property value
Methods
| Name | Description |
|---|---|
| AcceptConnectionAsync(CancellationToken) | Waits for the next connection whose handshake completed. |
| DisposeAsync() | Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources asynchronously. |
| ListenAsync(MsQuicListenerOptions, CancellationToken) | Starts listening. |
AcceptConnectionAsync(CancellationToken)
MsQuicListener.csWaits for the next connection whose handshake completed.
net10.0
public ValueTask<MsQuicConnection> AcceptConnectionAsync(CancellationToken cancellationToken = default)net11.0
public ValueTask<MsQuicConnection> AcceptConnectionAsync(CancellationToken cancellationToken = default)Parameters
cancellationTokenCancellationToken
Returns
Exceptions
ObjectDisposedException- The listener is disposed.
DisposeAsync()
MsQuicListener.csListenAsync(MsQuicListenerOptions, CancellationToken)
MsQuicListener.csStarts listening.
public static ValueTask<MsQuicListener> ListenAsync(MsQuicListenerOptions options, CancellationToken cancellationToken = default)Parameters
optionsMsQuicListenerOptionscancellationTokenCancellationToken
Returns
Exceptions
PlatformNotSupportedException- MsQuic is not available.
MsQuicException- The listener could not start, for instance because the address is in use.