Share via


HttpConnectionFactory.ConnectAsync(TransferFormat, CancellationToken) Method

Definition

Creates a new connection to a SignalR server using the specified TransferFormat.

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)

Parameters

transferFormat
TransferFormat

The transfer format the connection should use.

cancellationToken
CancellationToken

The token to monitor for cancellation requests. The default value is None.

Returns

A Task<TResult> that represents the asynchronous connect. The Result property returns a ConnectionContext for the new connection.

Implements

Applies to