HttpConnection 类

定义

用于使用基于 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
type HttpConnection = class
    inherit ConnectionContext
    interface IConnectionInherentKeepAliveFeature
Public Class HttpConnection
Inherits ConnectionContext
Implements IConnectionInherentKeepAliveFeature
继承
HttpConnection
继承
实现

构造函数

HttpConnection(HttpConnectionOptions, ILoggerFactory)

初始化 HttpConnection 类的新实例。

HttpConnection(Uri)

初始化 HttpConnection 类的新实例。

HttpConnection(Uri, HttpTransportType)

初始化 HttpConnection 类的新实例。

HttpConnection(Uri, HttpTransportType, ILoggerFactory)

初始化 HttpConnection 类的新实例。

属性

ConnectionClosed

客户端连接关闭时触发。

(继承自 ConnectionContext)
ConnectionId

获取或设置连接 ID。

Features

获取此连接上可用的服务器和中间件提供的功能的集合。

Items

获取或设置可用于在此连接范围内共享数据的键/值集合。

LocalEndPoint

获取或设置此连接的本地终结点。

(继承自 ConnectionContext)
RemoteEndPoint

获取或设置此连接的远程终结点。

(继承自 ConnectionContext)
Transport

获取或设置 IDuplexPipe 可用于在此连接上读取或写入数据的 。

方法

Abort()

中止基础连接。

(继承自 ConnectionContext)
Abort(ConnectionAbortedException)

中止基础连接。

(继承自 ConnectionContext)
DisposeAsync()

释放连接。

StartAsync(CancellationToken)

启动连接。

StartAsync(TransferFormat, CancellationToken)

使用指定的传输格式启动连接。

显式接口实现

IConnectionInherentKeepAliveFeature.HasInherentKeepAlive

获取连接是否具有固有的 keep-alive 概念。

扩展方法

GetHttpContext(ConnectionContext)

HttpContext获取与连接关联的 (如果有)。

适用于