HttpConnection 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
用於使用 HTTP 傳輸方式連接 ASP.NET Core ConnectionHandler。
public ref class HttpConnection : Microsoft::AspNetCore::Connections::ConnectionContext, Microsoft::AspNetCore::Connections::Features::IConnectionInherentKeepAliveFeature
public class HttpConnection : Microsoft.AspNetCore.Connections.ConnectionContext, Microsoft.AspNetCore.Connections.Features.IConnectionInherentKeepAliveFeature
public class HttpConnection : Microsoft.AspNetCore.Connections.ConnectionContext, Microsoft.AspNetCore.Connections.Features.IAuthenticationRefreshFeature, Microsoft.AspNetCore.Connections.Features.IConnectionInherentKeepAliveFeature
type HttpConnection = class
inherit ConnectionContext
interface IConnectionInherentKeepAliveFeature
type HttpConnection = class
inherit ConnectionContext
interface IConnectionInherentKeepAliveFeature
interface IAuthenticationRefreshFeature
Public Class HttpConnection
Inherits ConnectionContext
Implements IConnectionInherentKeepAliveFeature
Public Class HttpConnection
Inherits ConnectionContext
Implements IAuthenticationRefreshFeature, IConnectionInherentKeepAliveFeature
- 繼承
- 繼承
- 實作
建構函式
| 名稱 | Description |
|---|---|
| HttpConnection(HttpConnectionOptions, ILoggerFactory) |
初始化 HttpConnection 類別的新執行個體。 |
| HttpConnection(Uri, HttpTransportType, ILoggerFactory) |
初始化 HttpConnection 類別的新執行個體。 |
| HttpConnection(Uri, HttpTransportType) |
初始化 HttpConnection 類別的新執行個體。 |
| HttpConnection(Uri) |
初始化 HttpConnection 類別的新執行個體。 |
屬性
| 名稱 | Description |
|---|---|
| ConnectionClosed |
當客戶端連線關閉時會觸發。 (繼承來源 ConnectionContext) |
| ConnectionId |
取得或設定連線 ID。 |
| Features |
取得伺服器與中介軟體提供的功能集合,並可在此連線中使用。 |
| Items |
取得或設定一個鍵值集合,可用於在此連線範圍內分享資料。 |
| LocalEndPoint |
取得或設定此連線的本地端點。 (繼承來源 ConnectionContext) |
| RemoteEndPoint |
取得或設定此連線的遠端端點。 (繼承來源 ConnectionContext) |
| Transport |
取得或設定 IDuplexPipe 可用來讀寫此連線資料的 。 |
方法
| 名稱 | Description |
|---|---|
| Abort() |
中斷了底層的連結。 (繼承來源 ConnectionContext) |
| Abort(ConnectionAbortedException) |
中斷了底層的連結。 (繼承來源 ConnectionContext) |
| DisposeAsync() |
消除連結。 |
| StartAsync(CancellationToken) |
連線開始。 |
| StartAsync(TransferFormat, CancellationToken) |
開始連線時會使用指定的傳輸格式。 |
明確介面實作
| 名稱 | Description |
|---|---|
| IAuthenticationRefreshFeature.InitialTokenLifetime |
取得伺服器在協商時提供的初始代幣壽命。 若伺服器未提供代幣壽命,則為空。 |
| IAuthenticationRefreshFeature.RefreshAuthenticationAsync(CancellationToken) |
向伺服器發送更新請求,並輸入新的認證憑證。 回傳更新後的代幣壽命,若未提供則為空。 |
| IConnectionInherentKeepAliveFeature.HasInherentKeepAlive |
判斷這段關係是否包含固有的「保持生命」概念。 |
擴充方法
| 名稱 | Description |
|---|---|
| GetHttpContext(ConnectionContext) |
如果有連線的話,會取得 HttpContext 相關聯。 |