HttpConnection Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Used to make a connection to an ASP.NET Core ConnectionHandler using an HTTP-based transport.
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
- Inheritance
- Inheritance
- Implements
Constructors
| Name | Description |
|---|---|
| HttpConnection(HttpConnectionOptions, ILoggerFactory) |
Initializes a new instance of the HttpConnection class. |
| HttpConnection(Uri, HttpTransportType, ILoggerFactory) |
Initializes a new instance of the HttpConnection class. |
| HttpConnection(Uri, HttpTransportType) |
Initializes a new instance of the HttpConnection class. |
| HttpConnection(Uri) |
Initializes a new instance of the HttpConnection class. |
Properties
| Name | Description |
|---|---|
| ConnectionClosed |
Triggered when the client connection is closed. (Inherited from ConnectionContext) |
| ConnectionId |
Gets or sets the connection ID. |
| Features |
Gets the collection of features provided by the server and middleware available on this connection. |
| Items |
Gets or sets a key/value collection that can be used to share data within the scope of this connection. |
| LocalEndPoint |
Gets or sets the local endpoint for this connection. (Inherited from ConnectionContext) |
| RemoteEndPoint |
Gets or sets the remote endpoint for this connection. (Inherited from ConnectionContext) |
| Transport |
Gets or sets the IDuplexPipe that can be used to read or write data on this connection. |
Methods
| Name | Description |
|---|---|
| Abort() |
Aborts the underlying connection. (Inherited from ConnectionContext) |
| Abort(ConnectionAbortedException) |
Aborts the underlying connection. (Inherited from ConnectionContext) |
| DisposeAsync() |
Disposes the connection. |
| StartAsync(CancellationToken) |
Starts the connection. |
| StartAsync(TransferFormat, CancellationToken) |
Starts the connection using the specified transfer format. |
Explicit Interface Implementations
| Name | Description |
|---|---|
| IAuthenticationRefreshFeature.InitialTokenLifetime |
Gets the initial token lifetime as provided by the server during negotiation. Null if the server did not provide a token lifetime. |
| IAuthenticationRefreshFeature.RefreshAuthenticationAsync(CancellationToken) |
Sends a refresh request to the server with new authentication credentials. Returns the updated token lifetime, or null if not provided. |
| IConnectionInherentKeepAliveFeature.HasInherentKeepAlive |
Gets whether or not the connection has an inherent keep-alive concept. |
Extension Methods
| Name | Description |
|---|---|
| GetHttpContext(ConnectionContext) |
Gets the HttpContext associated with the connection, if there is one. |