Dela via


SocketTransportFactory.BindAsync(EndPoint, CancellationToken) Method

Definition

Creates an IConnectionListener bound to the specified EndPoint.

public System.Threading.Tasks.ValueTask<Microsoft.AspNetCore.Connections.IConnectionListener> BindAsync (System.Net.EndPoint endpoint, System.Threading.CancellationToken cancellationToken = default);
abstract member BindAsync : System.Net.EndPoint * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<Microsoft.AspNetCore.Connections.IConnectionListener>
override this.BindAsync : System.Net.EndPoint * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<Microsoft.AspNetCore.Connections.IConnectionListener>
Public Function BindAsync (endpoint As EndPoint, Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of IConnectionListener)

Parameters

endpoint
EndPoint

The EndPoint to bind to.

cancellationToken
CancellationToken

The token to monitor for cancellation requests.

Returns

A ValueTask<TResult> that completes when the listener has been bound, yielding a IConnectionListener representing the new listener.

Implements

Applies to