Freigeben über


HttpConnectionFactory.ConnectAsync(EndPoint, CancellationToken) Methode

Definition

Erstellt eine neue Verbindung mit einem UriEndPoint.

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>
override this.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)

Parameter

endPoint
EndPoint

Die , mit der UriEndPoint eine Verbindung hergestellt werden soll.

cancellationToken
CancellationToken

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

Gibt zurück

Ein ValueTask<TResult> , der die asynchrone Verbindung darstellt und nach Abschluss der neuen Verbindung den ConnectionContext ergibt.

Implementiert

Gilt für: