Dela via


HttpConnectionFactory.ConnectAsync(EndPoint, CancellationToken) Method

Definition

Creates a new connection to an UriEndPoint.

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

Parameters

endPoint
EndPoint

The UriEndPoint to connect to.

cancellationToken
CancellationToken

The token to monitor for cancellation requests. The default value is None.

Returns

A ValueTask<TResult> that represents the asynchronous connect, yielding the ConnectionContext for the new connection when completed.

Implements

Applies to