HubConnectionBuilderExtensions.WithAutomaticReconnect 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
WithAutomaticReconnect(IHubConnectionBuilder) |
設定 , HubConnection 以在連線遺失時自動嘗試重新連線。 用戶端會分別等候預設的 0、2、10 和 30 秒,再嘗試最多四次重新連線嘗試。 |
WithAutomaticReconnect(IHubConnectionBuilder, IRetryPolicy) |
設定 , HubConnection 以在連線遺失時自動嘗試重新連線。 |
WithAutomaticReconnect(IHubConnectionBuilder, TimeSpan[]) |
設定 , HubConnection 以在連線遺失時自動嘗試重新連線。 |
WithAutomaticReconnect(IHubConnectionBuilder)
設定 , HubConnection 以在連線遺失時自動嘗試重新連線。 用戶端會分別等候預設的 0、2、10 和 30 秒,再嘗試最多四次重新連線嘗試。
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
參數
- hubConnectionBuilder
- IHubConnectionBuilder
要設定的 IHubConnectionBuilder。
傳回
用於鏈結的相同 IHubConnectionBuilder 執行個體。
適用於
WithAutomaticReconnect(IHubConnectionBuilder, IRetryPolicy)
設定 , HubConnection 以在連線遺失時自動嘗試重新連線。
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
參數
- hubConnectionBuilder
- IHubConnectionBuilder
要設定的 IHubConnectionBuilder。
- retryPolicy
- IRetryPolicy
, IRetryPolicy 控制重新連線嘗試的時間和次數。
傳回
用於鏈結的相同 IHubConnectionBuilder 執行個體。
適用於
WithAutomaticReconnect(IHubConnectionBuilder, TimeSpan[])
設定 , HubConnection 以在連線遺失時自動嘗試重新連線。
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
參數
- hubConnectionBuilder
- IHubConnectionBuilder
要設定的 IHubConnectionBuilder。
- reconnectDelays
- TimeSpan[]
陣列,包含嘗試每次重新連線嘗試之前延遲的陣列。 陣列的長度代表用戶端停止嘗試重新連線之前所花費的失敗重新連線次數。
傳回
用於鏈結的相同 IHubConnectionBuilder 執行個體。