共用方式為


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 完成時產生新連線的 。

適用於