HubConnectionContext 建構函式
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
HubConnectionContext(ConnectionContext, HubConnectionContextOptions, ILoggerFactory)
初始化 HubConnectionContext 類別的新執行個體。
public:
HubConnectionContext(Microsoft::AspNetCore::Connections::ConnectionContext ^ connectionContext, Microsoft::AspNetCore::SignalR::HubConnectionContextOptions ^ contextOptions, Microsoft::Extensions::Logging::ILoggerFactory ^ loggerFactory);
public HubConnectionContext (Microsoft.AspNetCore.Connections.ConnectionContext connectionContext, Microsoft.AspNetCore.SignalR.HubConnectionContextOptions contextOptions, Microsoft.Extensions.Logging.ILoggerFactory loggerFactory);
new Microsoft.AspNetCore.SignalR.HubConnectionContext : Microsoft.AspNetCore.Connections.ConnectionContext * Microsoft.AspNetCore.SignalR.HubConnectionContextOptions * Microsoft.Extensions.Logging.ILoggerFactory -> Microsoft.AspNetCore.SignalR.HubConnectionContext
Public Sub New (connectionContext As ConnectionContext, contextOptions As HubConnectionContextOptions, loggerFactory As ILoggerFactory)
參數
- connectionContext
- ConnectionContext
- contextOptions
- HubConnectionContextOptions
設定 HubConnectionCoNtext 的選項。
- loggerFactory
- ILoggerFactory
記錄器工廠。
適用於
HubConnectionContext(ConnectionContext, TimeSpan, ILoggerFactory)
初始化 HubConnectionContext 類別的新執行個體。
public:
HubConnectionContext(Microsoft::AspNetCore::Connections::ConnectionContext ^ connectionContext, TimeSpan keepAliveInterval, Microsoft::Extensions::Logging::ILoggerFactory ^ loggerFactory);
public HubConnectionContext (Microsoft.AspNetCore.Connections.ConnectionContext connectionContext, TimeSpan keepAliveInterval, Microsoft.Extensions.Logging.ILoggerFactory loggerFactory);
new Microsoft.AspNetCore.SignalR.HubConnectionContext : Microsoft.AspNetCore.Connections.ConnectionContext * TimeSpan * Microsoft.Extensions.Logging.ILoggerFactory -> Microsoft.AspNetCore.SignalR.HubConnectionContext
Public Sub New (connectionContext As ConnectionContext, keepAliveInterval As TimeSpan, loggerFactory As ILoggerFactory)
參數
- connectionContext
- ConnectionContext
- keepAliveInterval
- TimeSpan
存留時間間隔。 如果伺服器在此間隔內未傳送任何訊息,則會傳送 Ping 訊息。
- loggerFactory
- ILoggerFactory
記錄器工廠。
適用於
HubConnectionContext(ConnectionContext, TimeSpan, ILoggerFactory, TimeSpan)
初始化 HubConnectionContext 類別的新執行個體。
public:
HubConnectionContext(Microsoft::AspNetCore::Connections::ConnectionContext ^ connectionContext, TimeSpan keepAliveInterval, Microsoft::Extensions::Logging::ILoggerFactory ^ loggerFactory, TimeSpan clientTimeoutInterval);
public HubConnectionContext (Microsoft.AspNetCore.Connections.ConnectionContext connectionContext, TimeSpan keepAliveInterval, Microsoft.Extensions.Logging.ILoggerFactory loggerFactory, TimeSpan clientTimeoutInterval);
new Microsoft.AspNetCore.SignalR.HubConnectionContext : Microsoft.AspNetCore.Connections.ConnectionContext * TimeSpan * Microsoft.Extensions.Logging.ILoggerFactory * TimeSpan -> Microsoft.AspNetCore.SignalR.HubConnectionContext
Public Sub New (connectionContext As ConnectionContext, keepAliveInterval As TimeSpan, loggerFactory As ILoggerFactory, clientTimeoutInterval As TimeSpan)
參數
- connectionContext
- ConnectionContext
- keepAliveInterval
- TimeSpan
存留時間間隔。 如果伺服器在此間隔內未傳送任何訊息,則會傳送 Ping 訊息。
- loggerFactory
- ILoggerFactory
記錄器工廠。
- clientTimeoutInterval
- TimeSpan
我們在此間隔中未聽到的用戶端會假設已中斷連線。