Läs på engelska

Dela via


DefaultConnectionContext Class

Definition

The default implementation for the ConnectionContext.

C#
public class DefaultConnectionContext : Microsoft.AspNetCore.Connections.ConnectionContext, IDisposable, Microsoft.AspNetCore.Connections.Features.IConnectionIdFeature, Microsoft.AspNetCore.Connections.Features.IConnectionItemsFeature, Microsoft.AspNetCore.Connections.Features.IConnectionLifetimeFeature, Microsoft.AspNetCore.Connections.Features.IConnectionTransportFeature, Microsoft.AspNetCore.Connections.Features.IConnectionUserFeature
C#
public class DefaultConnectionContext : Microsoft.AspNetCore.Connections.ConnectionContext, Microsoft.AspNetCore.Connections.Features.IConnectionEndPointFeature, Microsoft.AspNetCore.Connections.Features.IConnectionIdFeature, Microsoft.AspNetCore.Connections.Features.IConnectionItemsFeature, Microsoft.AspNetCore.Connections.Features.IConnectionLifetimeFeature, Microsoft.AspNetCore.Connections.Features.IConnectionTransportFeature, Microsoft.AspNetCore.Connections.Features.IConnectionUserFeature
Inheritance
DefaultConnectionContext
Inheritance
Implements

Constructors

DefaultConnectionContext()

Creates the DefaultConnectionContext without Pipes to avoid upfront allocations. The caller is expected to set the Transport and Application pipes manually.

DefaultConnectionContext(String, IDuplexPipe, IDuplexPipe)

Creates the DefaultConnectionContext with the given transport and application pipes.

DefaultConnectionContext(String)

Creates the DefaultConnectionContext without Pipes to avoid upfront allocations. The caller is expected to set the Transport and Application pipes manually.

Properties

Application System.Object.Application
ConnectionClosed

Gets or sets the CancellationToken that is triggered when the connection is closed.

ConnectionId

Gets or sets the connection identifier.

Features

Gets the collection of features provided by the server and middleware available on this connection.

Items

Gets or sets the items associated with the connection.

LocalEndPoint

Gets or sets the local EndPoint.

LocalEndPoint

Gets or sets the local endpoint for this connection.

(Inherited from ConnectionContext)
RemoteEndPoint

Gets or sets the remote EndPoint.

RemoteEndPoint

Gets or sets the remote endpoint for this connection.

(Inherited from ConnectionContext)
Transport

Gets or sets the transport for the connection.

User

Gets or sets the user associated with the connection.

Methods

Abort()
Abort()

Aborts the underlying connection.

(Inherited from ConnectionContext)
Abort(ConnectionAbortedException)

Aborts the underlying connection.

Abort(ConnectionAbortedException)

Aborts the underlying connection.

(Inherited from ConnectionContext)
Dispose()
DisposeAsync()

Releases resources for the underlying connection.

DisposeAsync()

Releases resources for the underlying connection.

(Inherited from ConnectionContext)

Extension Methods

GetHttpContext(ConnectionContext)

Gets the HttpContext associated with the connection, if there is one.

Applies to

Produkt Versioner
ASP.NET Core 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0