Dela via


HubConnectionBuilderExtensions.WithAutomaticReconnect Method

Definition

Overloads

WithAutomaticReconnect(IHubConnectionBuilder)

Configures the HubConnection to automatically attempt to reconnect if the connection is lost. The client will wait the default 0, 2, 10 and 30 seconds respectively before trying up to four reconnect attempts.

WithAutomaticReconnect(IHubConnectionBuilder, IRetryPolicy)

Configures the HubConnection to automatically attempt to reconnect if the connection is lost.

WithAutomaticReconnect(IHubConnectionBuilder, TimeSpan[])

Configures the HubConnection to automatically attempt to reconnect if the connection is lost.

WithAutomaticReconnect(IHubConnectionBuilder)

Source:
HubConnectionBuilderExtensions.cs
Source:
HubConnectionBuilderExtensions.cs
Source:
HubConnectionBuilderExtensions.cs
Source:
HubConnectionBuilderExtensions.cs
Source:
HubConnectionBuilderExtensions.cs
Source:
HubConnectionBuilderExtensions.cs
Source:
HubConnectionBuilderExtensions.cs

Configures the HubConnection to automatically attempt to reconnect if the connection is lost. The client will wait the default 0, 2, 10 and 30 seconds respectively before trying up to four reconnect attempts.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::SignalR::Client::IHubConnectionBuilder ^ WithAutomaticReconnect(Microsoft::AspNetCore::SignalR::Client::IHubConnectionBuilder ^ hubConnectionBuilder);
public static Microsoft.AspNetCore.SignalR.Client.IHubConnectionBuilder WithAutomaticReconnect (this Microsoft.AspNetCore.SignalR.Client.IHubConnectionBuilder hubConnectionBuilder);
static member WithAutomaticReconnect : Microsoft.AspNetCore.SignalR.Client.IHubConnectionBuilder -> Microsoft.AspNetCore.SignalR.Client.IHubConnectionBuilder
<Extension()>
Public Function WithAutomaticReconnect (hubConnectionBuilder As IHubConnectionBuilder) As IHubConnectionBuilder

Parameters

hubConnectionBuilder
IHubConnectionBuilder

The IHubConnectionBuilder to configure.

Returns

The same instance of the IHubConnectionBuilder for chaining.

Applies to

WithAutomaticReconnect(IHubConnectionBuilder, IRetryPolicy)

Source:
HubConnectionBuilderExtensions.cs
Source:
HubConnectionBuilderExtensions.cs
Source:
HubConnectionBuilderExtensions.cs
Source:
HubConnectionBuilderExtensions.cs
Source:
HubConnectionBuilderExtensions.cs
Source:
HubConnectionBuilderExtensions.cs
Source:
HubConnectionBuilderExtensions.cs

Configures the HubConnection to automatically attempt to reconnect if the connection is lost.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::SignalR::Client::IHubConnectionBuilder ^ WithAutomaticReconnect(Microsoft::AspNetCore::SignalR::Client::IHubConnectionBuilder ^ hubConnectionBuilder, Microsoft::AspNetCore::SignalR::Client::IRetryPolicy ^ retryPolicy);
public static Microsoft.AspNetCore.SignalR.Client.IHubConnectionBuilder WithAutomaticReconnect (this Microsoft.AspNetCore.SignalR.Client.IHubConnectionBuilder hubConnectionBuilder, Microsoft.AspNetCore.SignalR.Client.IRetryPolicy retryPolicy);
static member WithAutomaticReconnect : Microsoft.AspNetCore.SignalR.Client.IHubConnectionBuilder * Microsoft.AspNetCore.SignalR.Client.IRetryPolicy -> Microsoft.AspNetCore.SignalR.Client.IHubConnectionBuilder
<Extension()>
Public Function WithAutomaticReconnect (hubConnectionBuilder As IHubConnectionBuilder, retryPolicy As IRetryPolicy) As IHubConnectionBuilder

Parameters

hubConnectionBuilder
IHubConnectionBuilder

The IHubConnectionBuilder to configure.

retryPolicy
IRetryPolicy

An IRetryPolicy that controls the timing and number of reconnect attempts.

Returns

The same instance of the IHubConnectionBuilder for chaining.

Applies to

WithAutomaticReconnect(IHubConnectionBuilder, TimeSpan[])

Source:
HubConnectionBuilderExtensions.cs
Source:
HubConnectionBuilderExtensions.cs
Source:
HubConnectionBuilderExtensions.cs
Source:
HubConnectionBuilderExtensions.cs
Source:
HubConnectionBuilderExtensions.cs
Source:
HubConnectionBuilderExtensions.cs
Source:
HubConnectionBuilderExtensions.cs

Configures the HubConnection to automatically attempt to reconnect if the connection is lost.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::SignalR::Client::IHubConnectionBuilder ^ WithAutomaticReconnect(Microsoft::AspNetCore::SignalR::Client::IHubConnectionBuilder ^ hubConnectionBuilder, cli::array <TimeSpan> ^ reconnectDelays);
public static Microsoft.AspNetCore.SignalR.Client.IHubConnectionBuilder WithAutomaticReconnect (this Microsoft.AspNetCore.SignalR.Client.IHubConnectionBuilder hubConnectionBuilder, TimeSpan[] reconnectDelays);
static member WithAutomaticReconnect : Microsoft.AspNetCore.SignalR.Client.IHubConnectionBuilder * TimeSpan[] -> Microsoft.AspNetCore.SignalR.Client.IHubConnectionBuilder
<Extension()>
Public Function WithAutomaticReconnect (hubConnectionBuilder As IHubConnectionBuilder, reconnectDelays As TimeSpan()) As IHubConnectionBuilder

Parameters

hubConnectionBuilder
IHubConnectionBuilder

The IHubConnectionBuilder to configure.

reconnectDelays
TimeSpan[]

An array containing the delays before trying each reconnect attempt. The length of the array represents how many failed reconnect attempts it takes before the client will stop attempting to reconnect.

Returns

The same instance of the IHubConnectionBuilder for chaining.

Applies to