6 types derived from ConnectionContext
Microsoft.AspNetCore.Connections.Abstractions (1)
DefaultConnectionContext.cs (1)
19public class DefaultConnectionContext : ConnectionContext,
Microsoft.AspNetCore.Http.Connections (1)
Internal\HttpConnectionContext.cs (1)
22internal sealed partial class HttpConnectionContext : ConnectionContext,
Microsoft.AspNetCore.Server.Kestrel.Core (3)
HttpsConfigurationService.cs (1)
189private sealed class ConnectionContextAdapter : ConnectionContext
Internal\WebTransport\WebTransportStream.cs (1)
16internal sealed class WebTransportStream : ConnectionContext, IStreamDirectionFeature, IStreamIdFeature, IConnectionItemsFeature
Middleware\LoggingMultiplexedConnectionMiddleware.cs (1)
86private sealed class LoggingConnectionContext : ConnectionContext
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (1)
src\aspnetcore\src\Servers\Kestrel\shared\TransportConnection.cs (1)
14internal abstract partial class TransportConnection : ConnectionContext
73 references to ConnectionContext
Aspire.Dashboard (1)
Authentication\Connection\ConnectionTypeMiddleware.cs (1)
24public async Task OnConnectionAsync(ConnectionContext context)
Microsoft.AspNetCore.Connections.Abstractions (17)
ConnectionBuilderExtensions.cs (6)
32/// If you aren't calling the next function, use <see cref="Run(IConnectionBuilder, Func{ConnectionContext, Task})"/> instead. 34/// Prefer using <see cref="Use(IConnectionBuilder, Func{ConnectionContext, ConnectionDelegate, Task})"/> for better performance as shown below: 46public static IConnectionBuilder Use(this IConnectionBuilder connectionBuilder, Func<ConnectionContext, Func<Task>, Task> middleware) 60/// If you aren't calling the next function, use <see cref="Run(IConnectionBuilder, Func{ConnectionContext, Task})"/> instead. 65public static IConnectionBuilder Use(this IConnectionBuilder connectionBuilder, Func<ConnectionContext, ConnectionDelegate, Task> middleware) 76public static IConnectionBuilder Run(this IConnectionBuilder connectionBuilder, Func<ConnectionContext, Task> middleware)
ConnectionDelegate.cs (2)
11/// <param name="connection">A <see cref="ConnectionContext" /> representing the connection.</param> 13public delegate Task ConnectionDelegate(ConnectionContext connection);
ConnectionHandler.cs (2)
16/// <param name="connection">The new <see cref="ConnectionContext"/></param> 18public abstract Task OnConnectedAsync(ConnectionContext connection);
DefaultConnectionContext.cs (1)
17/// The default implementation for the <see cref="ConnectionContext"/>.
IConnectionFactory.cs (2)
21/// A <see cref="ValueTask{TResult}" /> that represents the asynchronous connect, yielding the <see cref="ConnectionContext" /> for the new connection when completed. 23ValueTask<ConnectionContext> ConnectAsync(EndPoint endpoint, CancellationToken cancellationToken = default);
IConnectionListener.cs (2)
25/// <returns>A <see cref="ValueTask{ConnectionContext}"/> that completes when a connection is accepted, yielding the <see cref="ConnectionContext" /> representing the connection.</returns> 26ValueTask<ConnectionContext?> AcceptAsync(CancellationToken cancellationToken = default);
MultiplexedConnectionContext.cs (2)
21public abstract ValueTask<ConnectionContext?> AcceptAsync(CancellationToken cancellationToken = default); 29public abstract ValueTask<ConnectionContext> ConnectAsync(IFeatureCollection? features = null, CancellationToken cancellationToken = default);
Microsoft.AspNetCore.Http.Connections (4)
Features\IHttpContextFeature.cs (1)
9/// Feature set on the <see cref="ConnectionContext"/> that provides access to the underlying <see cref="Http.HttpContext"/>
Features\IHttpTransportFeature.cs (1)
9/// Feature set on the <see cref="ConnectionContext"/> that exposes the <see cref="HttpTransportType"/>
HttpConnectionContextExtensions.cs (2)
17/// <param name="connection">The <see cref="ConnectionContext"/> representing the connection.</param> 23public static HttpContext? GetHttpContext(this ConnectionContext connection)
Microsoft.AspNetCore.Http.Features (2)
IWebTransportSession.cs (2)
33ValueTask<ConnectionContext?> AcceptStreamAsync(CancellationToken cancellationToken = default); 40ValueTask<ConnectionContext?> OpenUnidirectionalStreamAsync(CancellationToken cancellationToken = default);
Microsoft.AspNetCore.Server.Kestrel.Core (41)
HttpsConnectionAdapterOptions.cs (4)
51/// If SNI is not available then the name parameter will be null. The <see cref="ConnectionContext"/> will be null for HTTP/3 connections. 57public Func<ConnectionContext?, string?, X509Certificate2?>? ServerCertificateSelector { get; set; } 98public Action<ConnectionContext, SslServerAuthenticationOptions>? OnAuthenticate { get; set; } 111public Action<ConnectionContext, ReadOnlySequence<byte>>? TlsClientHelloBytesCallback { get; set; }
Internal\Http3\Http3Connection.cs (4)
365var streamContext = await _multiplexedContext.AcceptAsync(_acceptStreamsCts.Token); 595private async Task CreateHttp3Stream<TContext>(ConnectionContext streamContext, IHttpApplication<TContext> application, long streamId) where TContext : notnull 674internal Http3StreamContext CreateHttpStreamContext(ConnectionContext streamContext) 754var streamContext = await _multiplexedContext.ConnectAsync(features);
Internal\Http3\Http3FrameWriter.cs (2)
35private readonly ConnectionContext _connectionContext; 59public Http3FrameWriter(ConnectionContext connectionContext, ITimeoutControl timeoutControl, MinDataRate? minResponseDataRate, MemoryPool<byte> memoryPool, KestrelTrace log, IStreamIdFeature streamIdFeature, Http3PeerSettings clientPeerSettings, IHttp3Stream http3Stream)
Internal\Http3\Http3StreamContext.cs (2)
25ConnectionContext streamContext, 36public ConnectionContext StreamContext { get; }
Internal\Infrastructure\TransportManager.cs (2)
196private sealed class GenericConnectionListener : IConnectionListener<ConnectionContext> 207public ValueTask<ConnectionContext?> AcceptAsync(CancellationToken cancellationToken = default)
Internal\KestrelServerImpl.cs (1)
439return new ConnectionLimitMiddleware<ConnectionContext>(c => innerDelegate(c), connectionLimit.Value, trace, metrics).OnConnectionAsync;
Internal\SniOptionsSelector.cs (3)
25private readonly Func<ConnectionContext, string?, X509Certificate2?>? _fallbackServerCertificateSelector; 26private readonly Action<ConnectionContext, SslServerAuthenticationOptions>? _onAuthenticateCallback; 116public (SslServerAuthenticationOptions, ClientCertificateMode) GetOptions(ConnectionContext connection, string serverName)
Internal\TlsConnectionFeature.cs (2)
18private readonly ConnectionContext _context; 36public TlsConnectionFeature(SslStream sslStream, ConnectionContext context)
Internal\WebTransport\WebTransportSession.cs (3)
122public async ValueTask<ConnectionContext?> OpenUnidirectionalStreamAsync(CancellationToken cancellationToken) 131var connectionContext = await _connection._multiplexedContext.ConnectAsync(features, cancellationToken); 166public async ValueTask<ConnectionContext?> AcceptStreamAsync(CancellationToken cancellationToken)
ListenOptionsHttpsExtensions.cs (2)
291/// The callback to invoke with the <see cref="ConnectionContext"/> and the raw TLS Client Hello bytes 304public static ListenOptions UseTlsClientHelloListener(this ListenOptions listenOptions, Action<ConnectionContext, ReadOnlySequence<byte>> tlsClientHelloBytesCallback, TimeSpan? timeout = null)
Middleware\HttpConnectionMiddleware.cs (1)
28public Task OnConnectionAsync(ConnectionContext connectionContext)
Middleware\HttpsConnectionMiddleware.cs (4)
42private readonly Func<ConnectionContext, string?, X509Certificate2?>? _serverCertificateSelector; 145public async Task OnConnectionAsync(ConnectionContext context) 346private Task DoOptionsBasedHandshakeAsync(ConnectionContext context, SslStream sslStream, Core.Internal.TlsConnectionFeature feature, CancellationToken cancellationToken) 471var (middleware, context, feature, metricsContext) = (ValueTuple<HttpsConnectionMiddleware, ConnectionContext, Core.Internal.TlsConnectionFeature, ConnectionMetricsContext>)state!;
Middleware\LoggingConnectionMiddleware.cs (1)
20public async Task OnConnectionAsync(ConnectionContext context)
Middleware\LoggingMultiplexedConnectionMiddleware.cs (6)
57public override async ValueTask<ConnectionContext?> AcceptAsync(CancellationToken cancellationToken = default) 59var context = await _inner.AcceptAsync(cancellationToken); 67public override async ValueTask<ConnectionContext> ConnectAsync(IFeatureCollection? features = null, CancellationToken cancellationToken = default) 69var context = await _inner.ConnectAsync(features, cancellationToken); 88private readonly ConnectionContext _inner; 92public LoggingConnectionContext(ConnectionContext inner, ILogger logger)
Middleware\TlsListener.cs (3)
12private readonly Action<ConnectionContext, ReadOnlySequence<byte>> _tlsClientHelloBytesCallback; 14public TlsListener(Action<ConnectionContext, ReadOnlySequence<byte>> tlsClientHelloBytesCallback) 25internal async Task OnTlsClientHelloAsync(ConnectionContext connection, CancellationToken cancellationToken)
TlsHandshakeCallbackContext.cs (1)
42public ConnectionContext Connection { get; internal set; } = default!;
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (2)
Internal\QuicConnectionContext.cs (2)
93public override async ValueTask<ConnectionContext?> AcceptAsync(CancellationToken cancellationToken = default) 210public override async ValueTask<ConnectionContext> ConnectAsync(IFeatureCollection? features = null, CancellationToken cancellationToken = default)
Microsoft.AspNetCore.SignalR.Core (6)
HubConnectionContext.cs (3)
28private readonly ConnectionContext _connectionContext; 67/// <param name="connectionContext">The underlying <see cref="ConnectionContext"/>.</param> 70public HubConnectionContext(ConnectionContext connectionContext, HubConnectionContextOptions contextOptions, ILoggerFactory loggerFactory)
HubConnectionHandler.cs (1)
108public override async Task OnConnectedAsync(ConnectionContext connection)
src\aspnetcore\src\SignalR\common\Shared\MessageBuffer.cs (2)
64public MessageBuffer(ConnectionContext connection, IHubProtocol protocol, long bufferLimit, ILogger logger) 69public MessageBuffer(ConnectionContext connection, IHubProtocol protocol, long bufferLimit, ILogger logger, TimeProvider timeProvider)