IConnectionListener.AcceptAsync(CancellationToken) Method

Definition

Begins an asynchronous operation to accept an incoming connection.

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

Parameters

cancellationToken
CancellationToken

The token to monitor for cancellation requests.

Returns

ValueTask<ConnectionContext>

A ValueTask<TResult> that completes when a connection is accepted, yielding the ConnectionContext representing the connection.

Applies to