1 instantiation of HttpConnection
System.Net.Http (1)
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.Http1.cs (1)
304return new HttpConnection(this, newStream, transportContext, activity, remoteEndPoint);
82 references to HttpConnection
System.Net.Http (82)
System\Net\Http\SocketsHttpHandler\AuthenticationHelper.NtAuth.cs (4)
51private static Task<HttpResponseMessage> InnerSendAsync(HttpRequestMessage request, bool async, bool isProxyAuth, HttpConnectionPool pool, HttpConnection connection, CancellationToken cancellationToken) 76private static async Task<HttpResponseMessage> SendWithNtAuthAsync(HttpRequestMessage request, Uri authUri, bool async, ICredentials credentials, TokenImpersonationLevel impersonationLevel, bool isProxyAuth, HttpConnection connection, HttpConnectionPool connectionPool, CancellationToken cancellationToken) 235public static Task<HttpResponseMessage> SendWithNtProxyAuthAsync(HttpRequestMessage request, Uri proxyUri, bool async, ICredentials proxyCredentials, TokenImpersonationLevel impersonationLevel, HttpConnection connection, HttpConnectionPool connectionPool, CancellationToken cancellationToken) 240public static Task<HttpResponseMessage> SendWithNtConnectionAuthAsync(HttpRequestMessage request, bool async, ICredentials credentials, TokenImpersonationLevel impersonationLevel, HttpConnection connection, HttpConnectionPool connectionPool, CancellationToken cancellationToken)
System\Net\Http\SocketsHttpHandler\ChunkedEncodingReadStream.cs (2)
23public ChunkedEncodingReadStream(HttpConnection connection, HttpResponseMessage response) : base(connection) 512ctr = cts.Token.Register(static s => ((HttpConnection)s!).Dispose(), _connection);
System\Net\Http\SocketsHttpHandler\ChunkedEncodingWriteStream.cs (5)
17public ChunkedEncodingWriteStream(HttpConnection connection) : base(connection) 25HttpConnection connection = GetConnectionOrThrow(); 49HttpConnection connection = GetConnectionOrThrow(); 64static async ValueTask WriteChunkAsync(HttpConnection connection, ReadOnlyMemory<byte> buffer) 79HttpConnection connection = GetConnectionOrThrow();
System\Net\Http\SocketsHttpHandler\ConnectionCloseReadStream.cs (6)
14public ConnectionCloseReadStream(HttpConnection connection) : base(connection) 20HttpConnection? connection = _connection; 42HttpConnection? connection = _connection; 99HttpConnection? connection = _connection; 116private async Task CompleteCopyToAsync(Task copyTask, HttpConnection connection, CancellationToken cancellationToken) 141private void Finish(HttpConnection connection)
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.cs (5)
243_http11RequestQueue = new RequestQueue<HttpConnection>(); 383private Task<HttpResponseMessage> SendWithNtConnectionAuthAsync(HttpConnection connection, HttpRequestMessage request, bool async, bool doRequestAuth, CancellationToken cancellationToken) 393public Task<HttpResponseMessage> SendWithNtProxyAuthAsync(HttpConnection connection, HttpRequestMessage request, bool async, CancellationToken cancellationToken) 411HttpConnectionWaiter<HttpConnection>? http11ConnectionWaiter = null; 489if (!TryGetPooledHttp11Connection(request, async, out HttpConnection? connection, out http11ConnectionWaiter))
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.Http1.cs (26)
18private readonly ConcurrentStack<HttpConnection> _http11Connections = new(); 19/// <summary>Controls whether we can use a fast path when returning connections to the pool and skip calling into <see cref="ProcessHttp11RequestQueue(HttpConnection?)"/>.</summary> 28private RequestQueue<HttpConnection> _http11RequestQueue; 35private bool TryGetPooledHttp11Connection(HttpRequestMessage request, bool async, [NotNullWhen(true)] out HttpConnection? connection, [NotNullWhen(false)] out HttpConnectionWaiter<HttpConnection>? waiter) 61waiter = new HttpConnectionWaiter<HttpConnection>(); 93private void ProcessHttp11RequestQueue(HttpConnection? connection) 98HttpConnectionWaiter<HttpConnection>? waiter = null; 245RequestQueue<HttpConnection>.QueueItem queueItem = _http11RequestQueue.PeekNextRequestForConnectionAttempt(); 250private async Task InjectNewHttp11ConnectionAsync(RequestQueue<HttpConnection>.QueueItem queueItem) 258HttpConnectionWaiter<HttpConnection> waiter = queueItem.Waiter; 259HttpConnection? connection = null; 295internal async ValueTask<HttpConnection> CreateHttp11ConnectionAsync(HttpRequestMessage request, bool async, CancellationToken cancellationToken) 301private async ValueTask<HttpConnection> ConstructHttp11ConnectionAsync(bool async, Stream stream, TransportContext? transportContext, HttpRequestMessage request, Activity? activity, IPEndPoint? remoteEndPoint, CancellationToken cancellationToken) 307private void HandleHttp11ConnectionFailure(HttpConnectionWaiter<HttpConnection>? requestWaiter, Exception e) 327public void RecycleHttp11Connection(HttpConnection connection) 339private void AddNewHttp11Connection(HttpConnection connection, HttpConnectionWaiter<HttpConnection>? initialRequestWaiter) 368private void ReturnHttp11Connection(HttpConnection connection) 413public void InvalidateHttp11Connection(HttpConnection connection, bool disposing = true) 426private static void ScavengeHttp11ConnectionStack(HttpConnectionPool pool, ConcurrentStack<HttpConnection> connections, ref List<HttpConnectionBase>? toDispose, long nowTicks, TimeSpan pooledConnectionLifetime, TimeSpan pooledConnectionIdleTimeout) 439HttpConnection[] stackCopy = ArrayPool<HttpConnection>.Shared.Rent(pool._associatedHttp11ConnectionCount); 442while (connections.TryPop(out HttpConnection? connection)) 458Span<HttpConnection> usable = stackCopy.AsSpan(0, usableConnections); 464ArrayPool<HttpConnection>.Shared.Return(stackCopy);
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.Http2.cs (1)
344HttpConnection http11Connection;
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionWaiter.cs (2)
29Debug.Assert(typeof(T) == typeof(HttpConnection) || typeof(T) == typeof(Http2Connection)); 46int versionMajor = typeof(T) == typeof(HttpConnection) ? 1 : 2;
System\Net\Http\SocketsHttpHandler\ContentLengthReadStream.cs (2)
17public ContentLengthReadStream(HttpConnection connection, ulong contentLength) : base(connection) 224ctr = cts.Token.Register(static s => ((HttpConnection)s!).Dispose(), _connection);
System\Net\Http\SocketsHttpHandler\ContentLengthWriteStream.cs (3)
16public ContentLengthWriteStream(HttpConnection connection, long contentLength) 31HttpConnection connection = GetConnectionOrThrow(); 45HttpConnection connection = GetConnectionOrThrow();
System\Net\Http\SocketsHttpHandler\HttpConnection.cs (3)
962var connection = (HttpConnection)s!; 2127public sealed override string ToString() => $"{nameof(HttpConnection)}({_pool})"; // Description for diagnostic purposes
System\Net\Http\SocketsHttpHandler\HttpConnectionBase.cs (4)
45Debug.Assert(this is HttpConnection or Http2Connection or Http3Connection); 66this is HttpConnection ? "1.1" : 91if (this is HttpConnection) HttpTelemetry.Log.Http11ConnectionEstablished(Id, scheme, host, port, remoteEndPoint); 106if (this is HttpConnection) HttpTelemetry.Log.Http11ConnectionClosed(Id);
System\Net\Http\SocketsHttpHandler\HttpContentReadStream.cs (3)
16public HttpContentReadStream(HttpConnection connection) : base(connection) 37HttpConnection? connection = _connection; 74HttpConnection? connection = _connection; // Will be null after drain succeeds
System\Net\Http\SocketsHttpHandler\HttpContentStream.cs (4)
8protected internal HttpConnection? _connection; 10public HttpContentStream(HttpConnection connection) 35protected HttpConnection GetConnectionOrThrow() 37HttpConnection? c = _connection;
System\Net\Http\SocketsHttpHandler\HttpContentWriteStream.cs (2)
17public HttpContentWriteStream(HttpConnection connection) : base(connection) => 28HttpConnection? connection = _connection;
System\Net\Http\SocketsHttpHandler\RawConnectionStream.cs (10)
16public RawConnectionStream(HttpConnection connection) : base(connection) 26HttpConnection? connection = _connection; 49HttpConnection? connection = _connection; 101HttpConnection? connection = _connection; 118private async Task CompleteCopyToAsync(Task copyTask, HttpConnection connection, CancellationToken cancellationToken) 143private void Finish(HttpConnection connection) 152HttpConnection? connection = _connection; 171HttpConnection? connection = _connection; 197HttpConnection? connection = _connection; 209private static async Task WaitWithConnectionCancellationAsync(ValueTask task, HttpConnection connection, CancellationToken cancellationToken)