HubConnectionBuilder 類別

定義

用於設定 HubConnection 實例的產生器。

public ref class HubConnectionBuilder : Microsoft::AspNetCore::SignalR::Client::IHubConnectionBuilder, Microsoft::AspNetCore::SignalR::ISignalRBuilder
public class HubConnectionBuilder : Microsoft.AspNetCore.SignalR.Client.IHubConnectionBuilder, Microsoft.AspNetCore.SignalR.ISignalRBuilder
type HubConnectionBuilder = class
    interface IHubConnectionBuilder
    interface ISignalRBuilder
Public Class HubConnectionBuilder
Implements IHubConnectionBuilder, ISignalRBuilder
繼承
HubConnectionBuilder
實作

建構函式

HubConnectionBuilder()

初始化 HubConnectionBuilder 類別的新執行個體。

屬性

Services

取得產生器服務集合。

方法

Build()

建立 HubConnection

Equals(Object)

用於設定 HubConnection 實例的產生器。

GetHashCode()

用於設定 HubConnection 實例的產生器。

GetType()

取得目前執行個體的 Type

ToString()

用於設定 HubConnection 實例的產生器。

擴充方法

ConfigureLogging(IHubConnectionBuilder, Action<ILoggingBuilder>)

新增用於設定所提供 ILoggingBuilder 的委派。 可能會多次呼叫此項。

WithAutomaticReconnect(IHubConnectionBuilder)

設定 HubConnection ,以在連線遺失時自動嘗試重新連線。 用戶端會分別等候預設的 0、2、10 和 30 秒,再嘗試最多四次重新連線嘗試。

WithAutomaticReconnect(IHubConnectionBuilder, IRetryPolicy)

設定 HubConnection ,以在連線遺失時自動嘗試重新連線。

WithAutomaticReconnect(IHubConnectionBuilder, TimeSpan[])

設定 HubConnection ,以在連線遺失時自動嘗試重新連線。

WithKeepAliveInterval(IHubConnectionBuilder, TimeSpan)

設定 的 HubConnection KeepAliveInterval。

WithServerTimeout(IHubConnectionBuilder, TimeSpan)

設定 的 HubConnection ServerTimeout。

WithStatefulReconnect(IHubConnectionBuilder)

設定 HttpConnectionOptions ,以與伺服器交涉具狀態重新連線。

WithUrl(IHubConnectionBuilder, String)

HubConnection 設定為使用 HTTP 型傳輸來連線至指定的 URL。

WithUrl(IHubConnectionBuilder, String, HttpTransportType)

HubConnection 設定為使用 HTTP 型傳輸來連線到指定的 URL 和傳輸。

WithUrl(IHubConnectionBuilder, String, HttpTransportType, Action<HttpConnectionOptions>)

HubConnection 設定為使用 HTTP 型傳輸來連線到指定的 URL 和傳輸。

WithUrl(IHubConnectionBuilder, String, Action<HttpConnectionOptions>)

HubConnection 設定為使用 HTTP 型傳輸來連線至指定的 URL。

WithUrl(IHubConnectionBuilder, Uri)

HubConnection 設定為使用 HTTP 型傳輸來連線至指定的 URL。

WithUrl(IHubConnectionBuilder, Uri, HttpTransportType)

HubConnection 設定為使用 HTTP 型傳輸來連線到指定的 URL 和傳輸。

WithUrl(IHubConnectionBuilder, Uri, HttpTransportType, Action<HttpConnectionOptions>)

HubConnection 設定為使用 HTTP 型傳輸來連線到指定的 URL 和傳輸。

WithUrl(IHubConnectionBuilder, Uri, Action<HttpConnectionOptions>)

HubConnection 設定為使用 HTTP 型傳輸來連線至指定的 URL。

WithMessagePackProtocol(IHubConnectionBuilder)

用於設定 HubConnection 實例的產生器。

WithMessagePackProtocol(IHubConnectionBuilder, MessagePackHubProtocolOptions)

用於設定 HubConnection 實例的產生器。

AddMessagePackProtocol(ISignalRBuilder)

啟用 SignalR 的 MsgPack 通訊協定。

AddMessagePackProtocol(ISignalRBuilder, Action<MessagePackHubProtocolOptions>)

啟用 SignalR 的 MsgPack 通訊協定,並允許設定 MsgPack 通訊協定的選項。

適用於