14 instantiations of SocketsHttpHandler
Aspire.Dashboard (1)
ServiceClient\DashboardClient.cs (1)
119
var httpHandler = new
SocketsHttpHandler
Aspire.Dashboard.Tests (5)
Integration\IntegrationTestHelpers.cs (2)
119
var handler = new
SocketsHttpHandler
180
var handler = new
SocketsHttpHandler
Integration\TelemetryApiTests.cs (3)
101
using var handler = new
SocketsHttpHandler
{ AllowAutoRedirect = false };
173
using var handler = new
SocketsHttpHandler
{ AllowAutoRedirect = false };
342
using var handler = new
SocketsHttpHandler
{ AllowAutoRedirect = false };
Aspire.Hosting.Tests (1)
DistributedApplicationTests.cs (1)
1525
using var client2 = new HttpClient(new
SocketsHttpHandler
Aspire.Seq (1)
SeqHealthCheck.cs (1)
14
readonly HttpClient _client = new(new
SocketsHttpHandler
{ ActivityHeadersPropagator = null }) { BaseAddress = new Uri(seqUri) };
Microsoft.DotNet.Arcade.Sdk (1)
src\DownloadFile.cs (1)
131
using SocketsHttpHandler handler = new
SocketsHttpHandler
();
Microsoft.Extensions.Http (2)
DefaultHttpMessageHandlerBuilder.cs (1)
68
SocketsHttpHandler handler =
new
();
DependencyInjection\HttpClientBuilderExtensions.cs (1)
296
handler = new
SocketsHttpHandler
();
Microsoft.NET.Build.Containers (1)
Registry\DefaultRegistryAPI.cs (1)
60
var socketsHttpHandler = new
SocketsHttpHandler
()
System.Net.Http (1)
System\Net\Http\HttpClientHandler.cs (1)
75
_underlyingHandler = new
HttpHandlerType
();
System.Net.Requests (1)
System\Net\HttpWebRequest.cs (1)
1691
var handler = new
SocketsHttpHandler
();
96 references to SocketsHttpHandler
Aspire.Dashboard (2)
ServiceClient\DashboardClient.cs (2)
82
Action<
SocketsHttpHandler
>? configureHttpHandler = null)
119
var
httpHandler = new SocketsHttpHandler
Aspire.Dashboard.Tests (5)
Integration\IntegrationTestHelpers.cs (2)
119
var
handler = new SocketsHttpHandler
180
var
handler = new SocketsHttpHandler
Integration\TelemetryApiTests.cs (3)
101
using
var
handler = new SocketsHttpHandler { AllowAutoRedirect = false };
173
using
var
handler = new SocketsHttpHandler { AllowAutoRedirect = false };
342
using
var
handler = new SocketsHttpHandler { AllowAutoRedirect = false };
Microsoft.DotNet.Arcade.Sdk (1)
src\DownloadFile.cs (1)
131
using
SocketsHttpHandler
handler = new SocketsHttpHandler();
Microsoft.Extensions.Http (44)
DefaultHttpMessageHandlerBuilder.cs (2)
66
if (
SocketsHttpHandler
.IsSupported)
68
SocketsHttpHandler
handler = new();
DependencyInjection\HttpClientBuilderExtensions.cs (11)
271
/// Adds or updates <see cref="
SocketsHttpHandler
"/> as a primary handler for a named <see cref="HttpClient"/>. If provided,
272
/// also adds a delegate that will be used to configure the primary <see cref="
SocketsHttpHandler
"/>.
275
/// <param name="configureHandler">Optional delegate that is used to configure the primary <see cref="
SocketsHttpHandler
"/>.</param>
279
/// If a primary handler was already set to be <see cref="
SocketsHttpHandler
"/> by previously calling, for example,
282
/// delegate will be applied to the existing instance. Otherwise, a new instance of <see cref="
SocketsHttpHandler
"/> will be created.
286
public static IHttpClientBuilder UseSocketsHttpHandler(this IHttpClientBuilder builder, Action<
SocketsHttpHandler
, IServiceProvider>? configureHandler = null)
294
if (b.PrimaryHandler is not
SocketsHttpHandler
handler)
307
/// Adds or updates <see cref="
SocketsHttpHandler
"/> as a primary handler for a named <see cref="HttpClient"/>
311
/// <param name="configureBuilder">Delegate that is used to set up the configuration of the primary <see cref="
SocketsHttpHandler
"/>
316
/// If a primary handler was already set to be <see cref="
SocketsHttpHandler
"/> by previously calling, for example,
320
/// <see cref="
SocketsHttpHandler
"/> will be created.
DependencyInjection\ISocketsHttpHandlerBuilder.cs (1)
8
/// Configures <see cref="System.Net.Http.
SocketsHttpHandler
"/> for a named
DependencyInjection\SocketsHttpHandlerBuilderExtensions.cs (29)
15
/// Extension methods to configure <see cref="
SocketsHttpHandler
"/> for a named
21
/// Adds a delegate that will be used to configure the primary <see cref="
SocketsHttpHandler
"/> for a
25
/// <param name="configure">A delegate that is used to modify a <see cref="
SocketsHttpHandler
"/>.</param>
28
public static ISocketsHttpHandlerBuilder Configure(this ISocketsHttpHandlerBuilder builder, Action<
SocketsHttpHandler
, IServiceProvider> configure)
34
if (b.PrimaryHandler is not
SocketsHttpHandler
socketsHttpHandler)
36
string message = SR.Format(SR.SocketsHttpHandlerBuilder_PrimaryHandlerIsInvalid, nameof(b.PrimaryHandler), typeof(
SocketsHttpHandler
).FullName, Environment.NewLine, b.PrimaryHandler?.ToString() ?? "(null)");
47
/// Uses <see cref="IConfiguration"/> to configure the primary <see cref="
SocketsHttpHandler
"/> for a
51
/// <param name="configuration">Configuration containing properties of <see cref="
SocketsHttpHandler
"/>.</param>
55
/// Only simple (of type `bool`, `int`, <see cref="Enum"/> or <see cref="TimeSpan"/>) properties of <see cref="
SocketsHttpHandler
"/> will be parsed.
69
private static void FillFromConfig(
SocketsHttpHandler
handler, in SocketsHttpHandlerConfiguration config)
195
PooledConnectionIdleTimeout = ParseTimeSpan(config[nameof(
SocketsHttpHandler
.PooledConnectionIdleTimeout)]),
196
PooledConnectionLifetime = ParseTimeSpan(config[nameof(
SocketsHttpHandler
.PooledConnectionLifetime)]),
197
PreAuthenticate = ParseBool(config[nameof(
SocketsHttpHandler
.PreAuthenticate)]),
198
ResponseDrainTimeout = ParseTimeSpan(config[nameof(
SocketsHttpHandler
.ResponseDrainTimeout)]),
199
UseCookies = ParseBool(config[nameof(
SocketsHttpHandler
.UseCookies)]),
200
UseProxy = ParseBool(config[nameof(
SocketsHttpHandler
.UseProxy)]),
201
EnableMultipleHttp2Connections = ParseBool(config[nameof(
SocketsHttpHandler
.EnableMultipleHttp2Connections)]),
202
MaxResponseHeadersLength = ParseInt(config[nameof(
SocketsHttpHandler
.MaxResponseHeadersLength)]),
203
MaxResponseDrainSize = ParseInt(config[nameof(
SocketsHttpHandler
.MaxResponseDrainSize)]),
204
MaxConnectionsPerServer = ParseInt(config[nameof(
SocketsHttpHandler
.MaxConnectionsPerServer)]),
205
MaxAutomaticRedirections = ParseInt(config[nameof(
SocketsHttpHandler
.MaxAutomaticRedirections)]),
206
InitialHttp2StreamWindowSize = ParseInt(config[nameof(
SocketsHttpHandler
.InitialHttp2StreamWindowSize)]),
207
AllowAutoRedirect = ParseBool(config[nameof(
SocketsHttpHandler
.AllowAutoRedirect)]),
208
AutomaticDecompression = ParseEnum<DecompressionMethods>(config[nameof(
SocketsHttpHandler
.AutomaticDecompression)]),
209
ConnectTimeout = ParseTimeSpan(config[nameof(
SocketsHttpHandler
.ConnectTimeout)]),
210
Expect100ContinueTimeout = ParseTimeSpan(config[nameof(
SocketsHttpHandler
.Expect100ContinueTimeout)]),
211
KeepAlivePingDelay = ParseTimeSpan(config[nameof(
SocketsHttpHandler
.KeepAlivePingDelay)]),
212
KeepAlivePingTimeout = ParseTimeSpan(config[nameof(
SocketsHttpHandler
.KeepAlivePingTimeout)]),
213
KeepAlivePingPolicy = ParseEnum<HttpKeepAlivePingPolicy>(config[nameof(
SocketsHttpHandler
.KeepAlivePingPolicy)])
MetricsFactoryHttpMessageHandlerFilter.cs (1)
36
else if (!OperatingSystem.IsBrowser() && !OperatingSystem.IsWasi() && builder.PrimaryHandler is
SocketsHttpHandler
socketsHttpHandler)
Microsoft.Extensions.ServiceDiscovery (1)
..\..\..\..\src\Libraries\Microsoft.Extensions.ServiceDiscovery\ServiceDiscoveryHttpClientBuilderExtensions.cs (1)
83
if (builder.PrimaryHandler is
SocketsHttpHandler
socketsHttpHandler)
Microsoft.NET.Build.Containers (1)
Registry\DefaultRegistryAPI.cs (1)
60
var
socketsHttpHandler = new SocketsHttpHandler()
System.Net.Http (40)
System\Net\Http\HttpClientHandler.cs (6)
22
using HttpHandlerType = System.Net.Http.
SocketsHttpHandler
;
29
private readonly
HttpHandlerType
_underlyingHandler;
68
private
HttpHandlerType
Handler => _underlyingHandler;
91
public virtual bool SupportsAutomaticDecompression =>
HttpHandlerType
.SupportsAutomaticDecompression;
92
public virtual bool SupportsProxy =>
HttpHandlerType
.SupportsProxy;
93
public virtual bool SupportsRedirectConfiguration =>
HttpHandlerType
.SupportsRedirectConfiguration;
System\Net\Http\HttpProtocolException.cs (1)
13
/// When calling <see cref="HttpClient"/> or <see cref="
SocketsHttpHandler
"/> methods, <see cref="HttpProtocolException"/> will be the inner exception of
System\Net\Http\HttpRequestMessage.cs (6)
135
/// When the request is sent through a <see cref="
SocketsHttpHandler
"/>, the value matches the connection id
137
/// <see cref="
SocketsHttpHandler
.ShouldEvictConnection"/> for the connection that served the request, allowing
139
/// <see cref="
SocketsHttpHandler
.ConnectCallback"/>. When a request is sent over multiple connections (for
143
/// <see cref="
SocketsHttpHandler
.ConnectCallback"/>: when the request is served over such a tunnel, the callback
146
/// <see cref="
SocketsHttpHandler
.PlaintextStreamFilter"/>, which runs once per hop and reports the transport
150
/// These correlations apply only when the request is handled by <see cref="
SocketsHttpHandler
"/>. Another
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.cs (3)
690
Trace($"{nameof(
SocketsHttpHandler
.ConnectCallback)} completing asynchronously for a synchronous request.");
769
Trace($"{nameof(
SocketsHttpHandler
.PlaintextStreamFilter)} completing asynchronously for a synchronous request.");
944
/// Invokes the user-supplied <see cref="
SocketsHttpHandler
.ShouldEvictConnection"/> callback for each
System\Net\Http\SocketsHttpHandler\HttpConnectionBase.cs (8)
34
/// The context passed to the <see cref="
SocketsHttpHandler
.ShouldEvictConnection"/> callback.
40
/// Allocated at establishment only when <see cref="
SocketsHttpHandler
.ShouldEvictConnection"/>
47
/// <see cref="
SocketsHttpHandler
.ShouldEvictConnection"/> callback.
52
/// Set while the <see cref="
SocketsHttpHandler
.ShouldEvictConnection"/> callback is running for this connection.
64
/// <summary>Whether the connection has been marked for eviction by <see cref="
SocketsHttpHandler
.ShouldEvictConnection"/> and should no longer be used for new requests.</summary>
87
/// the same id can be surfaced to <see cref="
SocketsHttpHandler
.ConnectCallback"/> and telemetry.</summary>
253
/// Runs the <see cref="
SocketsHttpHandler
.ShouldEvictConnection"/> callback for this connection
283
if (NetEventSource.Log.IsEnabled()) Trace($"{nameof(
SocketsHttpHandler
.ShouldEvictConnection)} threw an exception: {e}");
System\Net\Http\SocketsHttpHandler\SocketsHttpConnectionContext.cs (3)
39
/// <see cref="
SocketsHttpHandler
.ShouldEvictConnection"/>, and the
47
/// id, which is the one reported to <see cref="
SocketsHttpHandler
.ShouldEvictConnection"/> and stamped on those
48
/// requests. A <see cref="
SocketsHttpHandler
.PlaintextStreamFilter"/> runs on each hop and surfaces both: this
System\Net\Http\SocketsHttpHandler\SocketsHttpConnectionEvictionContext.cs (5)
10
/// Represents the context passed to <see cref="
SocketsHttpHandler
.ShouldEvictConnection"/> when a pooled
51
/// <see cref="
SocketsHttpHandler
.ConnectCallback"/> returned a stream that is not backed by a socket.
60
/// <see cref="
SocketsHttpHandler
.ConnectCallback"/>. It allows the eviction decision to be correlated
64
/// For an HTTP CONNECT proxy tunnel the id seen by a custom <see cref="
SocketsHttpHandler
.ConnectCallback"/>
67
/// <see cref="
SocketsHttpHandler
.PlaintextStreamFilter"/>, which runs on each hop and reports the transport
System\Net\Http\SocketsHttpHandler\SocketsHttpHandler.cs (4)
276
/// Defines the initial HTTP2 stream receive window size for all connections opened by the this <see cref="
SocketsHttpHandler
"/>.
304
/// <see cref="
SocketsHttpHandler
.KeepAlivePingTimeout"/> to close broken connections.
515
/// Gets or sets the <see cref="IMeterFactory"/> to create a custom <see cref="Meter"/> for the <see cref="
SocketsHttpHandler
"/> instance.
518
/// When <see cref="MeterFactory"/> is set to a non-<see langword="null"/> value, all metrics emitted by the <see cref="
SocketsHttpHandler
"/> instance
System\Net\Http\SocketsHttpHandler\SocketsHttpPlaintextStreamFilterContext.cs (4)
47
/// <see cref="
SocketsHttpHandler
.ConnectCallback"/>, the
49
/// <see cref="
SocketsHttpHandler
.ShouldEvictConnection"/>, and the <see cref="HttpRequestMessage.ConnectionId"/>
55
/// connection's id (the one the <see cref="
SocketsHttpHandler
.ConnectCallback"/> observed), and on the
57
/// <see cref="
SocketsHttpHandler
.ShouldEvictConnection"/> and stamped on requests).
System.Net.Requests (2)
System\Net\HttpWebRequest.cs (2)
1691
var
handler = new SocketsHttpHandler();
1712
static extern object GetSettings(
SocketsHttpHandler
handler);