Freigeben über


HttpConnectionFactory.ConnectAsync(TransferFormat, CancellationToken) Methode

Definition

Erstellt mithilfe des angegebenen TransferFormateine neue Verbindung mit einem SignalR-Server.

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

Parameter

transferFormat
TransferFormat

Das Übertragungsformat, das die Verbindung verwenden soll.

cancellationToken
CancellationToken

Das Token zum Überwachen von Abbruchanforderungen. Der Standardwert ist None.

Gibt zurück

Eine Task<TResult> , die die asynchrone Verbindung darstellt. Die Result -Eigenschaft gibt einen ConnectionContext für die neue Verbindung zurück.

Implementiert

Gilt für: