19 types derived from ConnectionContext
ClientSample (1)
Tcp\TcpConnection.cs (1)
18public class TcpConnection : ConnectionContext, IConnectionInherentKeepAliveFeature
InMemory.FunctionalTests (2)
src\Servers\Kestrel\shared\test\Http3\Http3InMemory.cs (1)
1091internal class TestStreamContext : ConnectionContext, IStreamDirectionFeature, IStreamIdFeature, IProtocolErrorCodeFeature, IPersistentStateFeature, IStreamAbortFeature, IDisposable, IStreamClosedFeature
src\Servers\Kestrel\shared\TransportConnection.cs (1)
14internal abstract partial class TransportConnection : 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.Http.Connections.Client (1)
HttpConnection.cs (1)
28public partial class HttpConnection : ConnectionContext, IConnectionInherentKeepAliveFeature
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.Core.Tests (1)
SniOptionsSelectorTests.cs (1)
937private class MockConnectionContext : ConnectionContext
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (2)
src\Servers\Kestrel\shared\test\Http3\Http3InMemory.cs (1)
1091internal class TestStreamContext : ConnectionContext, IStreamDirectionFeature, IStreamIdFeature, IProtocolErrorCodeFeature, IPersistentStateFeature, IStreamAbortFeature, IDisposable, IStreamClosedFeature
src\Servers\Kestrel\shared\TransportConnection.cs (1)
14internal abstract partial class TransportConnection : ConnectionContext
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (1)
src\Servers\Kestrel\shared\TransportConnection.cs (1)
14internal abstract partial class TransportConnection : ConnectionContext
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (1)
src\Servers\Kestrel\shared\TransportConnection.cs (1)
14internal abstract partial class TransportConnection : ConnectionContext
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (1)
src\Servers\Kestrel\shared\TransportConnection.cs (1)
14internal abstract partial class TransportConnection : ConnectionContext
Microsoft.AspNetCore.SignalR.Client.Tests (2)
HubConnectionTests.Reconnect.cs (1)
1165private class DisposeInterceptingConnectionContextDecorator : ConnectionContext
TestConnection.cs (1)
22internal class TestConnection : ConnectionContext, IConnectionInherentKeepAliveFeature
Microsoft.AspNetCore.SignalR.Microbenchmarks (1)
Shared\TestConnectionContext.cs (1)
10public class TestConnectionContext : ConnectionContext
Microsoft.AspNetCore.SignalR.Tests (1)
Internal\MessageBufferTests.cs (1)
498internal sealed class TestConnectionContext : ConnectionContext
263 references to ConnectionContext
Aspire.Dashboard (1)
Authentication\Connection\ConnectionTypeMiddleware.cs (1)
24public async Task OnConnectionAsync(ConnectionContext context)
ClientSample (2)
Tcp\TcpConnection.cs (1)
59public async ValueTask<ConnectionContext> StartAsync()
Tcp\TcpHubConnectionBuilderExtensions.cs (1)
48public ValueTask<ConnectionContext> ConnectAsync(EndPoint endPoint, CancellationToken cancellationToken = default)
http2cat (2)
src\Shared\Http2cat\Http2CatHostedService.cs (1)
73await using var context = await _connectionFactory.ConnectAsync(endpoint);
src\Shared\Http2cat\Http2Utilities.cs (1)
135public Http2Utilities(ConnectionContext clientConnectionContext, ILogger logger, CancellationToken stopToken)
IIS.FunctionalTests (2)
src\Shared\Http2cat\Http2CatHostedService.cs (1)
73await using var context = await _connectionFactory.ConnectAsync(endpoint);
src\Shared\Http2cat\Http2Utilities.cs (1)
135public Http2Utilities(ConnectionContext clientConnectionContext, ILogger logger, CancellationToken stopToken)
IIS.LongTests (2)
src\Shared\Http2cat\Http2CatHostedService.cs (1)
73await using var context = await _connectionFactory.ConnectAsync(endpoint);
src\Shared\Http2cat\Http2Utilities.cs (1)
135public Http2Utilities(ConnectionContext clientConnectionContext, ILogger logger, CancellationToken stopToken)
IIS.NewHandler.FunctionalTests (2)
src\Shared\Http2cat\Http2CatHostedService.cs (1)
73await using var context = await _connectionFactory.ConnectAsync(endpoint);
src\Shared\Http2cat\Http2Utilities.cs (1)
135public Http2Utilities(ConnectionContext clientConnectionContext, ILogger logger, CancellationToken stopToken)
IIS.NewShim.FunctionalTests (2)
src\Shared\Http2cat\Http2CatHostedService.cs (1)
73await using var context = await _connectionFactory.ConnectAsync(endpoint);
src\Shared\Http2cat\Http2Utilities.cs (1)
135public Http2Utilities(ConnectionContext clientConnectionContext, ILogger logger, CancellationToken stopToken)
IISExpress.FunctionalTests (2)
src\Shared\Http2cat\Http2CatHostedService.cs (1)
73await using var context = await _connectionFactory.ConnectAsync(endpoint);
src\Shared\Http2cat\Http2Utilities.cs (1)
135public Http2Utilities(ConnectionContext clientConnectionContext, ILogger logger, CancellationToken stopToken)
InMemory.FunctionalTests (33)
ConnectionLimitTests.cs (1)
240var middleware = new ConnectionLimitMiddleware<ConnectionContext>(c => next(c), concurrentConnectionCounter, serviceContext.Log, metrics: serviceContext.Metrics);
ConnectionMiddlewareTests.cs (2)
340public async Task OnConnectionAsync(ConnectionContext context) 372public async Task OnConnectionAsync(ConnectionContext context)
EventSourceTests.cs (1)
376return new ConnectionLimitMiddleware<ConnectionContext>(c => next(c), connectionLimit: 0, serviceContext.Log, metrics: null).OnConnectionAsync;
Http2\Http2TestBase.cs (2)
124protected readonly Mock<ConnectionContext> _mockConnectionContext = new Mock<ConnectionContext>();
Http3\Http3ConnectionTests.cs (11)
404var streamContext1 = await MakeRequestAsync(0, headers, sendData: true, waitForServerDispose: true); 405var streamContext2 = await MakeRequestAsync(1, headers, sendData: true, waitForServerDispose: true); 431var streamContext1 = await MakeRequestAsync(0, headers, sendData: true, waitForServerDispose: true); 435var streamContext2 = await MakeRequestAsync(1, headers, sendData: true, waitForServerDispose: true); 471var streamContext1 = await MakeRequestAsync(0, requestHeaders1, sendData: true, waitForServerDispose: true); 478var streamContext2 = await MakeRequestAsync(1, requestHeaders2, sendData: true, waitForServerDispose: true); 505ConnectionContext first = null; 506ConnectionContext last = null; 511var streamContext = await MakeRequestAsync(i, headers, sendData: true, waitForServerDispose: true); 762public override async ValueTask<ConnectionContext> AcceptAsync(CancellationToken cancellationToken = default) 782private async Task<ConnectionContext> MakeRequestAsync(int index, KeyValuePair<string, string>[] headers, bool sendData, bool waitForServerDispose)
KestrelMetricsTests.cs (1)
321ConnectionContext currentConnectionContext = null;
src\Servers\Kestrel\shared\test\Http3\Http3InMemory.cs (6)
991public readonly Channel<ConnectionContext> ToServerAcceptQueue = Channel.CreateUnbounded<ConnectionContext>(new UnboundedChannelOptions 1051public override async ValueTask<ConnectionContext> AcceptAsync(CancellationToken cancellationToken = default) 1057while (ToServerAcceptQueue.Reader.TryRead(out var connection)) 1071public override ValueTask<ConnectionContext> ConnectAsync(IFeatureCollection features = null, CancellationToken cancellationToken = default) 1078return new ValueTask<ConnectionContext>(stream.StreamContext);
src\Servers\Kestrel\shared\test\PassThroughConnectionMiddleware.cs (1)
21public Task OnConnectionAsync(ConnectionContext context)
src\Servers\Kestrel\shared\test\TestContextFactory.cs (3)
49ConnectionContext connectionContext, 253public override ValueTask<ConnectionContext> AcceptAsync(CancellationToken cancellationToken = default) 258public override ValueTask<ConnectionContext> ConnectAsync(IFeatureCollection features = null, CancellationToken cancellationToken = default)
TestTransport\InMemoryTransportFactory.cs (5)
15private readonly Channel<ConnectionContext> _acceptQueue = Channel.CreateUnbounded<ConnectionContext>(); 19public void AddConnection(ConnectionContext connection) 24public async ValueTask<ConnectionContext> AcceptAsync(CancellationToken cancellationToken = default) 28while (_acceptQueue.Reader.TryRead(out var item))
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.Connections.Client (2)
HttpConnectionFactory.cs (2)
42/// A <see cref="ValueTask{TResult}" /> that represents the asynchronous connect, yielding the <see cref="ConnectionContext" /> for the new connection when completed. 44public async ValueTask<ConnectionContext> ConnectAsync(EndPoint endPoint, CancellationToken cancellationToken = default)
Microsoft.AspNetCore.Http.Connections.Tests (14)
HttpConnectionDispatcherTests.cs (10)
3806public override Task OnConnectedAsync(ConnectionContext connection) 3815public override Task OnConnectedAsync(ConnectionContext connection) 3825public override Task OnConnectedAsync(ConnectionContext connection) 3833public override Task OnConnectedAsync(ConnectionContext connection) 3841public override async Task OnConnectedAsync(ConnectionContext connection) 3878public override async Task OnConnectedAsync(ConnectionContext connection) 3903public override async Task OnConnectedAsync(ConnectionContext connection) 3933public override async Task OnConnectedAsync(ConnectionContext connection) 3960public override async Task OnConnectedAsync(ConnectionContext connection) 3990public override async Task OnConnectedAsync(ConnectionContext connection)
MapConnectionHandlerTests.cs (4)
432public override async Task OnConnectedAsync(ConnectionContext connection) 452public override Task OnConnectedAsync(ConnectionContext connection) 460public override Task OnConnectedAsync(ConnectionContext connection) 474public override Task OnConnectedAsync(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.HttpSys.FunctionalTests (2)
src\Shared\Http2cat\Http2CatHostedService.cs (1)
73await using var context = await _connectionFactory.ConnectAsync(endpoint);
src\Shared\Http2cat\Http2Utilities.cs (1)
135public Http2Utilities(ConnectionContext clientConnectionContext, ILogger logger, CancellationToken stopToken)
Microsoft.AspNetCore.Server.Kestrel.Core (36)
HttpsConnectionAdapterOptions.cs (3)
50/// If SNI is not available then the name parameter will be null. The <see cref="ConnectionContext"/> will be null for HTTP/3 connections. 56public Func<ConnectionContext?, string?, X509Certificate2?>? ServerCertificateSelector { get; set; } 97public Action<ConnectionContext, SslServerAuthenticationOptions>? OnAuthenticate { get; set; }
Internal\Http3\Http3Connection.cs (4)
363var streamContext = await _multiplexedContext.AcceptAsync(_acceptStreamsCts.Token); 581private async Task CreateHttp3Stream<TContext>(ConnectionContext streamContext, IHttpApplication<TContext> application, long streamId) where TContext : notnull 659internal Http3StreamContext CreateHttpStreamContext(ConnectionContext streamContext) 739var 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\ConnectionMetricsContext.cs (1)
10public required BaseConnectionContext ConnectionContext { get; init; }
Internal\Infrastructure\TransportManager.cs (2)
197private sealed class GenericConnectionListener : IConnectionListener<ConnectionContext> 208public ValueTask<ConnectionContext?> AcceptAsync(CancellationToken cancellationToken = default)
Internal\KestrelServerImpl.cs (1)
435return 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; 22public 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)
Middleware\HttpConnectionMiddleware.cs (1)
28public Task OnConnectionAsync(ConnectionContext connectionContext)
Middleware\HttpsConnectionMiddleware.cs (4)
41private readonly Func<ConnectionContext, string?, X509Certificate2?>? _serverCertificateSelector; 134public async Task OnConnectionAsync(ConnectionContext context) 316private Task DoOptionsBasedHandshakeAsync(ConnectionContext context, SslStream sslStream, Core.Internal.TlsConnectionFeature feature, CancellationToken cancellationToken) 441var (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)
TlsHandshakeCallbackContext.cs (1)
42public ConnectionContext Connection { get; internal set; } = default!;
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (35)
ConnectionContextTests.cs (1)
15var mockConnectionContext = new Mock<ConnectionContext> { CallBase = true };
ConnectionDispatcherTests.cs (6)
62var dispatcher = new ConnectionDispatcher<ConnectionContext>(serviceContext, _ => Task.CompletedTask, new TransportConnectionManager(serviceContext.ConnectionManager)); 118private static KestrelConnection<ConnectionContext> CreateKestrelConnection(TestServiceContext serviceContext, DefaultConnectionContext connection, TransportConnectionManager transportConnectionManager, Func<ConnectionContext, Task> connectionDelegate = null) 122return new KestrelConnection<ConnectionContext>( 126private class ThrowingListener : IConnectionListener<ConnectionContext> 130public ValueTask<ConnectionContext> AcceptAsync(CancellationToken cancellationToken = default)
Http1\Http1ConnectionTestsBase.cs (3)
41var connectionContext = Mock.Of<ConnectionContext>(); 56connectionContext: Mock.Of<ConnectionContext>(),
Http1\Http1HttpProtocolFeatureCollectionTests.cs (2)
29var connectionContext = Mock.Of<ConnectionContext>();
Http1\Http1OutputProducerTests.cs (4)
120var mockConnectionContext = new Mock<ConnectionContext>(); 225ConnectionContext connectionContext = null, 229connectionContext = connectionContext ?? Mock.Of<ConnectionContext>(); 254public TestHttpOutputProducer(Pipe pipe, string connectionId, ConnectionContext connectionContext, MemoryPool<byte> memoryPool, KestrelTrace log, ITimeoutControl timeoutControl, IHttpMinResponseDataRateFeature minResponseDataRateFeature, ConnectionMetricsContext metricsContext, IHttpOutputAborter outputAborter)
HttpConnectionManagerTests.cs (1)
49var httpConnection = new KestrelConnection<ConnectionContext>(0, serviceContext, transportConnectionManager, _ => Task.CompletedTask, mock.Object, trace, TestContextFactory.CreateMetricsContext(mock.Object));
HttpConnectionTests.cs (1)
22var mockConnectionContext = new Mock<ConnectionContext>();
HttpResponseHeadersTests.cs (2)
29var connectionContext = Mock.Of<ConnectionContext>();
KestrelServerTests.cs (8)
558.Returns(new ValueTask<ConnectionContext>((ConnectionContext)null)); 615.Returns(new ValueTask<ConnectionContext>((ConnectionContext)null)); 674.Returns(new ValueTask<ConnectionContext>((ConnectionContext)null)); 811.Returns(new ValueTask<ConnectionContext>(result: null)); 949.Returns(new ValueTask<ConnectionContext>(result: null));
src\Servers\Kestrel\shared\test\PassThroughConnectionMiddleware.cs (1)
21public Task OnConnectionAsync(ConnectionContext context)
src\Servers\Kestrel\shared\test\TestContextFactory.cs (3)
49ConnectionContext connectionContext, 253public override ValueTask<ConnectionContext> AcceptAsync(CancellationToken cancellationToken = default) 258public override ValueTask<ConnectionContext> ConnectAsync(IFeatureCollection features = null, CancellationToken cancellationToken = default)
StartLineTests.cs (1)
531connectionContext: Mock.Of<ConnectionContext>(),
TestHelpers\TestInput.cs (2)
33var connectionContext = Mock.Of<ConnectionContext>();
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (14)
InMemoryTransportBenchmark.cs (5)
135private readonly TaskCompletionSource<ConnectionContext> _tcs = new TaskCompletionSource<ConnectionContext>(TaskCreationOptions.RunContinuationsAsynchronously); 146public ValueTask<ConnectionContext> AcceptAsync(CancellationToken cancellationToken = default) 150return new ValueTask<ConnectionContext>(_connections[_acceptedConnections++]); 152return new ValueTask<ConnectionContext>(_tcs.Task);
src\Servers\Kestrel\shared\test\Http3\Http3InMemory.cs (6)
991public readonly Channel<ConnectionContext> ToServerAcceptQueue = Channel.CreateUnbounded<ConnectionContext>(new UnboundedChannelOptions 1051public override async ValueTask<ConnectionContext> AcceptAsync(CancellationToken cancellationToken = default) 1057while (ToServerAcceptQueue.Reader.TryRead(out var connection)) 1071public override ValueTask<ConnectionContext> ConnectAsync(IFeatureCollection features = null, CancellationToken cancellationToken = default) 1078return new ValueTask<ConnectionContext>(stream.StreamContext);
src\Servers\Kestrel\shared\test\TestContextFactory.cs (3)
49ConnectionContext connectionContext, 253public override ValueTask<ConnectionContext> AcceptAsync(CancellationToken cancellationToken = default) 258public override ValueTask<ConnectionContext> ConnectAsync(IFeatureCollection features = null, CancellationToken cancellationToken = default)
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (4)
Internal\NamedPipeConnectionListener.cs (4)
26private readonly Channel<ConnectionContext> _acceptedQueue; 52_acceptedQueue = Channel.CreateBounded<ConnectionContext>(new BoundedChannelOptions(capacity: 1)); 147public async ValueTask<ConnectionContext?> AcceptAsync(CancellationToken cancellationToken = default) 151if (_acceptedQueue.Reader.TryRead(out var connection))
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.Server.Kestrel.Transport.Quic.Tests (3)
QuicConnectionContextTests.cs (2)
96var serverStream = await acceptStreamTask.DefaultTimeout(); 610var serverStream = await requestState.ServerConnection.AcceptAsync().DefaultTimeout();
QuicTestHelpers.cs (1)
152var serverStream = await serverConnection.AcceptAsync().DefaultTimeout();
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (4)
Client\SocketConnectionFactory.cs (1)
47public async ValueTask<ConnectionContext> ConnectAsync(EndPoint endpoint, CancellationToken cancellationToken = default)
SocketConnectionContextFactory.cs (2)
84/// Create a <see cref="ConnectionContext"/> for a socket. 88public ConnectionContext Create(Socket socket)
SocketConnectionListener.cs (1)
59public async ValueTask<ConnectionContext?> AcceptAsync(CancellationToken cancellationToken = default)
Microsoft.AspNetCore.SignalR.Client.Core (6)
HubConnection.cs (4)
489var connection = await _connectionFactory.ConnectAsync(_endPoint, cancellationToken).ConfigureAwait(false); 547private static ValueTask CloseAsync(ConnectionContext connection) 2130public ConnectionContext Connection { get; } 2147public ConnectionState(ConnectionContext connection, HubConnection hubConnection)
src\SignalR\common\Shared\MessageBuffer.cs (2)
63public MessageBuffer(ConnectionContext connection, IHubProtocol protocol, long bufferLimit, ILogger logger) 68public MessageBuffer(ConnectionContext connection, IHubProtocol protocol, long bufferLimit, ILogger logger, TimeProvider timeProvider)
Microsoft.AspNetCore.SignalR.Client.FunctionalTests (4)
HubConnectionTests.cs (1)
73private static Func<EndPoint, ValueTask<ConnectionContext>> GetHttpConnectionFactory(string url, ILoggerFactory loggerFactory, string path, HttpTransportType transportType, TransferFormat transferFormat)
HubProtocolVersionTests.cs (3)
134var connectionContext = await proxyConnectionFactory.ConnectTask.DefaultTimeout(); 235public ValueTask<ConnectionContext> ConnectTask { get; private set; } 242public ValueTask<ConnectionContext> ConnectAsync(EndPoint endPoint, CancellationToken cancellationToken = default)
Microsoft.AspNetCore.SignalR.Client.Tests (7)
HubConnectionTests.ConnectionLifecycle.cs (2)
82ValueTask<ConnectionContext> ConnectionFactory(EndPoint endPoint) 114ValueTask<ConnectionContext> ConnectionFactory(EndPoint endPoint)
HubConnectionTests.Reconnect.cs (4)
1138public async ValueTask<ConnectionContext> ConnectAsync(EndPoint endPoint, CancellationToken cancellationToken = default) 1155public async Task DisposeAsync(ConnectionContext connection) 1167private readonly ConnectionContext _inner; 1170public DisposeInterceptingConnectionContextDecorator(ConnectionContext inner, ReconnectingConnectionFactory reconnectingConnectionFactory)
TestConnection.cs (1)
66public async ValueTask<ConnectionContext> StartAsync()
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\SignalR\common\Shared\MessageBuffer.cs (2)
63public MessageBuffer(ConnectionContext connection, IHubProtocol protocol, long bufferLimit, ILogger logger) 68public MessageBuffer(ConnectionContext connection, IHubProtocol protocol, long bufferLimit, ILogger logger, TimeProvider timeProvider)
Microsoft.AspNetCore.SignalR.Microbenchmarks (4)
DefaultHubDispatcherBenchmark.cs (1)
87public NoErrorHubConnectionContext(ConnectionContext connectionContext, HubConnectionContextOptions contextOptions, ILoggerFactory loggerFactory)
HubConnectionReceiveBenchmark.cs (1)
83return new ValueTask<ConnectionContext>(connection);
HubConnectionSendBenchmark.cs (1)
63return new ValueTask<ConnectionContext>(connection);
HubConnectionStartBenchmark.cs (1)
49return new ValueTask<ConnectionContext>(connection);
Microsoft.AspNetCore.SignalR.Specification.Tests (3)
src\SignalR\common\testassets\Tests.Utils\HubConnectionContextUtils.cs (3)
17public static HubConnectionContext Create(ConnectionContext connection, IHubProtocol protocol = null, string userIdentifier = null) 31public static MockHubConnectionContext CreateMock(ConnectionContext connection) 44public MockHubConnectionContext(ConnectionContext connectionContext, HubConnectionContextOptions contextOptions, ILoggerFactory loggerFactory)
Microsoft.AspNetCore.SignalR.Tests (5)
AuthConnectionHandler.cs (1)
14public override async Task OnConnectedAsync(ConnectionContext connection)
EchoConnectionHandler.cs (1)
12public override async Task OnConnectedAsync(ConnectionContext connection)
HttpHeaderConnectionHandler.cs (1)
16public override async Task OnConnectedAsync(ConnectionContext connection)
Internal\MessageBufferTests.cs (1)
542public static void UpdateConnectionPair(ref DuplexPipePair duplexPipePair, ConnectionContext connection, PipeOptions pipeOptions = null)
WriteThenCloseConnectionHandler.cs (1)
12public override async Task OnConnectedAsync(ConnectionContext connection)
Microsoft.AspNetCore.SignalR.Tests.Utils (6)
DelegateConnectionFactory.cs (3)
11private readonly Func<EndPoint, ValueTask<ConnectionContext>> _connectDelegate; 14public DelegateConnectionFactory(Func<EndPoint, ValueTask<ConnectionContext>> connectDelegate) 19public ValueTask<ConnectionContext> ConnectAsync(EndPoint endPoint, CancellationToken cancellationToken)
HubConnectionContextUtils.cs (3)
17public static HubConnectionContext Create(ConnectionContext connection, IHubProtocol protocol = null, string userIdentifier = null) 31public static MockHubConnectionContext CreateMock(ConnectionContext connection) 44public MockHubConnectionContext(ConnectionContext connectionContext, HubConnectionContextOptions contextOptions, ILoggerFactory loggerFactory)
SignalR.Client.FunctionalTestApp (1)
EchoConnectionHandler.cs (1)
11public override async Task OnConnectedAsync(ConnectionContext connection)
SignalRSamples (11)
ConnectionHandlers\MessagesConnectionHandler.cs (2)
15public override async Task OnConnectedAsync(ConnectionContext connection) 66foreach (var c in Connections)
ConnectionList.cs (9)
10internal class ConnectionList : IReadOnlyCollection<ConnectionContext> 12private readonly ConcurrentDictionary<string, ConnectionContext> _connections = new ConcurrentDictionary<string, ConnectionContext>(StringComparer.Ordinal); 14public ConnectionContext this[string connectionId] 18if (_connections.TryGetValue(connectionId, out var connection)) 28public void Add(ConnectionContext connection) 33public void Remove(ConnectionContext connection) 35_connections.TryRemove(connection.ConnectionId, out var dummy); 38public IEnumerator<ConnectionContext> GetEnumerator()
SocialWeather (16)
ConnectionList.cs (9)
10internal class ConnectionList : IReadOnlyCollection<ConnectionContext> 12private readonly ConcurrentDictionary<string, ConnectionContext> _connections = 13new ConcurrentDictionary<string, ConnectionContext>(StringComparer.Ordinal); 15public ConnectionContext this[string connectionId] 19if (_connections.TryGetValue(connectionId, out var connection)) 29public void Add(ConnectionContext connection) 34public void Remove(ConnectionContext connection) 36_connections.TryRemove(connection.ConnectionId, out var dummy); 39public IEnumerator<ConnectionContext> GetEnumerator()
PersistentConnectionLifeTimeManager.cs (5)
20public void OnConnectedAsync(ConnectionContext connection) 36public void OnDisconnectedAsync(ConnectionContext connection) 43foreach (var connection in _connectionList) 69public void AddGroupAsync(ConnectionContext connection, string groupName) 78public void RemoveGroupAsync(ConnectionContext connection, string groupName)
SocialWeatherConnectionHandler.cs (2)
23public override async Task OnConnectedAsync(ConnectionContext connection) 30public async Task ProcessRequests(ConnectionContext connection)
Sockets.FunctionalTests (2)
src\Servers\Kestrel\shared\test\PassThroughConnectionMiddleware.cs (1)
21public Task OnConnectionAsync(ConnectionContext context)
src\Servers\Kestrel\test\FunctionalTests\UnixDomainSocketsTests.cs (1)
46async Task EchoServer(ConnectionContext connection)
WebTransportInteractiveSampleApp (4)
Program.cs (4)
71ConnectionContext? stream = null; 93static async Task handleUnidirectionalStream(IWebTransportSession session, ConnectionContext stream) 113static async Task handleBidirectionalStream(IWebTransportSession session, ConnectionContext stream) 145var stream = await session.OpenUnidirectionalStreamAsync();
WebTransportSampleApp (1)
Program.cs (1)
34var stream = await session.AcceptStreamAsync(CancellationToken.None);