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