IConnectionFactory.ConnectAsync(EndPoint, CancellationToken) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Creates a new connection to an endpoint.
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>
Public Function ConnectAsync (endpoint As EndPoint, Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of ConnectionContext)
Parameters
- 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.