IWebTransportSession.AcceptStreamAsync(CancellationToken) Method

Definition

Returns the next incoming stream in the order the server received it. The stream can be either bidirectional or unidirectional.

public System.Threading.Tasks.ValueTask<Microsoft.AspNetCore.Connections.ConnectionContext?> AcceptStreamAsync (System.Threading.CancellationToken cancellationToken = default);
abstract member AcceptStreamAsync : System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<Microsoft.AspNetCore.Connections.ConnectionContext>
Public Function AcceptStreamAsync (Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of ConnectionContext)

Parameters

cancellationToken
CancellationToken

The cancellation token used to cancel the operation.

Returns

The unidirectional or bidirectional stream that is next in the queue, or null if the session has ended.

Remarks

To use WebTransport, you must first enable the Microsoft.AspNetCore.Server.Kestrel.Experimental.WebTransportAndH3Datagrams AppContextSwitch

Applies to