WebTransportListener Class
Listens for WebTransport sessions over HTTP/3.
public sealed class WebTransportListener : IAsyncDisposableRemarks
The listener accepts the QUIC connections and their WebTransport CONNECT requests. The other requests are answered with a 501 response. A connection can carry several sessions.
- Implements
Properties
| Name | Description |
|---|---|
| LocalEndPoint | Gets the address the listener listens on. |
LocalEndPoint
WebTransportListener.csMethods
| Name | Description |
|---|---|
| AcceptAsync(CancellationToken) | Waits for the next WebTransport CONNECT request. |
| DisposeAsync() | Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources asynchronously. |
| ListenAsync(WebTransportListenerOptions, CancellationToken) | Starts listening. |
AcceptAsync(CancellationToken)
WebTransportListener.csWaits for the next WebTransport CONNECT request.
net10.0
public ValueTask<WebTransportSessionRequest> AcceptAsync(CancellationToken cancellationToken = default)net11.0
public ValueTask<WebTransportSessionRequest> AcceptAsync(CancellationToken cancellationToken = default)Parameters
cancellationTokenCancellationToken
Returns
ValueTask<WebTransportSessionRequest>
Exceptions
ObjectDisposedException- The listener is disposed.
DisposeAsync()
WebTransportListener.csListenAsync(WebTransportListenerOptions, CancellationToken)
WebTransportListener.csStarts listening.
net10.0
public static ValueTask<WebTransportListener> ListenAsync(WebTransportListenerOptions options, CancellationToken cancellationToken = default)net11.0
public static ValueTask<WebTransportListener> ListenAsync(WebTransportListenerOptions options, CancellationToken cancellationToken = default)Parameters
optionsWebTransportListenerOptionscancellationTokenCancellationToken
Returns
ValueTask<WebTransportListener>
Exceptions
PlatformNotSupportedException- MsQuic is not available.