IMultiplexedConnectionFactory.ConnectAsync 方法

定义

创建与终结点的新连接。

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)

参数

endpoint
EndPoint

EndPoint 连接到的 。

features
IFeatureCollection

用于在连接时传递选项的功能集合。

cancellationToken
CancellationToken

要监视取消请求的标记。 默认值是 None

返回

表示 ValueTask<TResult> 异步连接的 ,在完成时为新连接生成 MultiplexedConnectionContext

适用于