Dela via


IMultiplexedConnectionFactory.ConnectAsync Method

Definition

Creates a new connection to an endpoint.

public System.Threading.Tasks.ValueTask<Microsoft.AspNetCore.Connections.MultiplexedConnectionContext> ConnectAsync (System.Net.EndPoint endpoint, Microsoft.AspNetCore.Http.Features.IFeatureCollection? features = default, System.Threading.CancellationToken cancellationToken = default);
abstract member ConnectAsync : System.Net.EndPoint * Microsoft.AspNetCore.Http.Features.IFeatureCollection * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<Microsoft.AspNetCore.Connections.MultiplexedConnectionContext>
Public Function ConnectAsync (endpoint As EndPoint, Optional features As IFeatureCollection = Nothing, Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of MultiplexedConnectionContext)

Parameters

endpoint
EndPoint

The EndPoint to connect to.

features
IFeatureCollection

A feature collection to pass options when connecting.

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 MultiplexedConnectionContext for the new connection when completed.

Applies to