HubConnectionContext 類別

定義

封裝與 SignalR 中樞之個別連線的相關資訊。

public ref class HubConnectionContext
public class HubConnectionContext
type HubConnectionContext = class
Public Class HubConnectionContext
繼承
HubConnectionContext

建構函式

HubConnectionContext(ConnectionContext, HubConnectionContextOptions, ILoggerFactory)

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

HubConnectionContext(ConnectionContext, TimeSpan, ILoggerFactory)

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

HubConnectionContext(ConnectionContext, TimeSpan, ILoggerFactory, TimeSpan)

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

屬性

ConnectionAborted

取得 , CancellationToken 這個值會在連接中止時通知。

ConnectionId

取得此連線的識別碼。

Features

取得這個連接上可用的功能集合。

Items

取得索引鍵/值集合,可用來共用此連接範圍內的資料。

Protocol

取得這個連接所使用的通訊協定。

User

取得此連線的使用者。

UserIdentifier

取得或設定這個連接的使用者識別碼。

方法

Abort()

中止連線。

WriteAsync(HubMessage, CancellationToken)

HubMessage將 寫入至連接。

WriteAsync(SerializedHubMessage, CancellationToken)

這個方法的設計訴求是支援架構,不適合供應用程式程式碼使用。 將預先序列化的訊息寫入連線。

擴充方法

GetHttpContext(HubConnectionContext)

HttpContext從指定的連接取得,如果連接未與 HTTP 要求相關聯,則 null 為 。

適用於