29 instantiations of SocketsHttpHandler
Aspire.Dashboard (1)
ResourceService\DashboardClient.cs (1)
117var httpHandler = new SocketsHttpHandler
Aspire.Dashboard.Tests (2)
Integration\IntegrationTestHelpers.cs (2)
117var handler = new SocketsHttpHandler 178var handler = new SocketsHttpHandler
Aspire.Hosting.Tests (1)
DistributedApplicationTests.cs (1)
709using var client2 = new HttpClient(new SocketsHttpHandler
Aspire.Seq (1)
SeqHealthCheck.cs (1)
14readonly HttpClient _client = new(new SocketsHttpHandler { ActivityHeadersPropagator = null }) { BaseAddress = new Uri(seqUri) };
HttpClientApp (1)
Program.cs (1)
12var handler = new SocketsHttpHandler();
HttpStress (1)
Program.cs (1)
512var handler = new SocketsHttpHandler()
IIS.Tests (1)
Utilities\TestServer.cs (1)
116HttpClient = new HttpClient(new LoggingHandler(new SocketsHttpHandler(), _loggerFactory.CreateLogger<TestServer>()))
InMemory.FunctionalTests (7)
EventSourceTests.cs (1)
166using var socketsHandler = new SocketsHttpHandler()
Http2\Http2EndToEndTests.cs (1)
49using var socketsHandler = new SocketsHttpHandler()
KestrelMetricsTests.cs (5)
555using var socketsHandler = new SocketsHttpHandler() 634using var socketsHandler = new SocketsHttpHandler() 702using var socketsHandler = new SocketsHttpHandler() 787using var socketsHandler = new SocketsHttpHandler() 871using var socketsHandler = new SocketsHttpHandler()
Interop.FunctionalTests (4)
Http3\Http3TlsTests.cs (1)
479var httpHandler = new SocketsHttpHandler();
HttpClientHttp2InteropTests.cs (2)
1627var handler = new SocketsHttpHandler(); 1672var handler = new SocketsHttpHandler();
HttpHelpers.cs (1)
40var handler = new SocketsHttpHandler();
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (2)
Listener\ResponseHeaderTests.cs (1)
218var handler = new SocketsHttpHandler();
ResponseHeaderTests.cs (1)
128var socketsHttpHandler = new SocketsHttpHandler() { ResponseHeaderEncodingSelector = (_, _) => Encoding.UTF8 };
Microsoft.DotNet.SignTool (1)
src\VerifySignatures.cs (1)
30private static readonly HttpClient client = new(new SocketsHttpHandler { PooledConnectionLifetime = TimeSpan.FromMinutes(10) });
Microsoft.Extensions.Http (2)
DefaultHttpMessageHandlerBuilder.cs (1)
69SocketsHttpHandler handler = new();
DependencyInjection\HttpClientBuilderExtensions.cs (1)
296handler = new SocketsHttpHandler();
Sockets.FunctionalTests (1)
src\Servers\Kestrel\test\FunctionalTests\Http2\ShutdownTests.cs (1)
32var handler = new SocketsHttpHandler
System.Net.Http (1)
System\Net\Http\HttpClientHandler.cs (1)
71_underlyingHandler = new HttpHandlerType();
System.Net.Requests (1)
System\Net\HttpWebRequest.cs (1)
1665var handler = new SocketsHttpHandler();
System.Net.WebSockets.Client (2)
System\Net\WebSockets\WebSocketHandle.Managed.cs (2)
262var invoker = new HttpMessageInvoker(new SocketsHttpHandler() 280var handler = new SocketsHttpHandler();
81 references to SocketsHttpHandler
Aspire.Dashboard (2)
ResourceService\DashboardClient.cs (2)
78Action<SocketsHttpHandler>? configureHttpHandler = null) 117var httpHandler = new SocketsHttpHandler
Aspire.Dashboard.Tests (2)
Integration\IntegrationTestHelpers.cs (2)
117var handler = new SocketsHttpHandler 178var handler = new SocketsHttpHandler
HttpClientApp (1)
Program.cs (1)
12var handler = new SocketsHttpHandler();
HttpStress (1)
Program.cs (1)
512var handler = new SocketsHttpHandler()
InMemory.FunctionalTests (7)
EventSourceTests.cs (1)
166using var socketsHandler = new SocketsHttpHandler()
Http2\Http2EndToEndTests.cs (1)
49using var socketsHandler = new SocketsHttpHandler()
KestrelMetricsTests.cs (5)
555using var socketsHandler = new SocketsHttpHandler() 634using var socketsHandler = new SocketsHttpHandler() 702using var socketsHandler = new SocketsHttpHandler() 787using var socketsHandler = new SocketsHttpHandler() 871using var socketsHandler = new SocketsHttpHandler()
Interop.FunctionalTests (4)
Http3\Http3TlsTests.cs (1)
479var httpHandler = new SocketsHttpHandler();
HttpClientHttp2InteropTests.cs (2)
1627var handler = new SocketsHttpHandler(); 1672var handler = new SocketsHttpHandler();
HttpHelpers.cs (1)
40var handler = new SocketsHttpHandler();
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (2)
Listener\ResponseHeaderTests.cs (1)
218var handler = new SocketsHttpHandler();
ResponseHeaderTests.cs (1)
128var socketsHttpHandler = new SocketsHttpHandler() { ResponseHeaderEncodingSelector = (_, _) => Encoding.UTF8 };
Microsoft.Extensions.Http (44)
DefaultHttpMessageHandlerBuilder.cs (2)
67if (SocketsHttpHandler.IsSupported) 69SocketsHttpHandler 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. 286public static IHttpClientBuilder UseSocketsHttpHandler(this IHttpClientBuilder builder, Action<SocketsHttpHandler, IServiceProvider>? configureHandler = null) 294if (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> 28public static ISocketsHttpHandlerBuilder Configure(this ISocketsHttpHandlerBuilder builder, Action<SocketsHttpHandler, IServiceProvider> configure) 34if (b.PrimaryHandler is not SocketsHttpHandler socketsHttpHandler) 36string 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. 69private static void FillFromConfig(SocketsHttpHandler handler, in SocketsHttpHandlerConfiguration config) 195PooledConnectionIdleTimeout = ParseTimeSpan(config[nameof(SocketsHttpHandler.PooledConnectionIdleTimeout)]), 196PooledConnectionLifetime = ParseTimeSpan(config[nameof(SocketsHttpHandler.PooledConnectionLifetime)]), 197PreAuthenticate = ParseBool(config[nameof(SocketsHttpHandler.PreAuthenticate)]), 198ResponseDrainTimeout = ParseTimeSpan(config[nameof(SocketsHttpHandler.ResponseDrainTimeout)]), 199UseCookies = ParseBool(config[nameof(SocketsHttpHandler.UseCookies)]), 200UseProxy = ParseBool(config[nameof(SocketsHttpHandler.UseProxy)]), 201EnableMultipleHttp2Connections = ParseBool(config[nameof(SocketsHttpHandler.EnableMultipleHttp2Connections)]), 202MaxResponseHeadersLength = ParseInt(config[nameof(SocketsHttpHandler.MaxResponseHeadersLength)]), 203MaxResponseDrainSize = ParseInt(config[nameof(SocketsHttpHandler.MaxResponseDrainSize)]), 204MaxConnectionsPerServer = ParseInt(config[nameof(SocketsHttpHandler.MaxConnectionsPerServer)]), 205MaxAutomaticRedirections = ParseInt(config[nameof(SocketsHttpHandler.MaxAutomaticRedirections)]), 206InitialHttp2StreamWindowSize = ParseInt(config[nameof(SocketsHttpHandler.InitialHttp2StreamWindowSize)]), 207AllowAutoRedirect = ParseBool(config[nameof(SocketsHttpHandler.AllowAutoRedirect)]), 208AutomaticDecompression = ParseEnum<DecompressionMethods>(config[nameof(SocketsHttpHandler.AutomaticDecompression)]), 209ConnectTimeout = ParseTimeSpan(config[nameof(SocketsHttpHandler.ConnectTimeout)]), 210Expect100ContinueTimeout = ParseTimeSpan(config[nameof(SocketsHttpHandler.Expect100ContinueTimeout)]), 211KeepAlivePingDelay = ParseTimeSpan(config[nameof(SocketsHttpHandler.KeepAlivePingDelay)]), 212KeepAlivePingTimeout = ParseTimeSpan(config[nameof(SocketsHttpHandler.KeepAlivePingTimeout)]), 213KeepAlivePingPolicy = ParseEnum<HttpKeepAlivePingPolicy>(config[nameof(SocketsHttpHandler.KeepAlivePingPolicy)])
MetricsFactoryHttpMessageHandlerFilter.cs (1)
36else if (!OperatingSystem.IsBrowser() && !OperatingSystem.IsWasi() && builder.PrimaryHandler is SocketsHttpHandler socketsHttpHandler)
Microsoft.Extensions.ServiceDiscovery (1)
ServiceDiscoveryHttpClientBuilderExtensions.cs (1)
76if (builder.PrimaryHandler is SocketsHttpHandler socketsHttpHandler)
Sockets.FunctionalTests (1)
src\Servers\Kestrel\test\FunctionalTests\Http2\ShutdownTests.cs (1)
32var handler = new SocketsHttpHandler
System.Net.Http (13)
System\Net\Http\HttpClientHandler.cs (6)
22using HttpHandlerType = System.Net.Http.SocketsHttpHandler; 29private readonly HttpHandlerType _underlyingHandler; 64private HttpHandlerType Handler => _underlyingHandler; 87public virtual bool SupportsAutomaticDecompression => HttpHandlerType.SupportsAutomaticDecompression; 88public virtual bool SupportsProxy => HttpHandlerType.SupportsProxy; 89public 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\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.cs (2)
679Trace($"{nameof(SocketsHttpHandler.ConnectCallback)} completing asynchronously for a synchronous request."); 756Trace($"{nameof(SocketsHttpHandler.PlaintextStreamFilter)} completing asynchronously for a synchronous request.");
System\Net\Http\SocketsHttpHandler\SocketsHttpHandler.cs (4)
271/// Defines the initial HTTP2 stream receive window size for all connections opened by the this <see cref="SocketsHttpHandler"/>. 299/// <see cref="SocketsHttpHandler.KeepAlivePingTimeout"/> to close broken connections. 475/// Gets or sets the <see cref="IMeterFactory"/> to create a custom <see cref="Meter"/> for the <see cref="SocketsHttpHandler"/> instance. 478/// When <see cref="MeterFactory"/> is set to a non-<see langword="null"/> value, all metrics emitted by the <see cref="SocketsHttpHandler"/> instance
System.Net.Requests (2)
System\Net\HttpWebRequest.cs (2)
1665var handler = new SocketsHttpHandler(); 1680var settings = typeof(SocketsHttpHandler).GetField("_settings", BindingFlags.NonPublic | BindingFlags.Instance)?.GetValue(handler);
System.Net.WebSockets.Client (1)
System\Net\WebSockets\WebSocketHandle.Managed.cs (1)
280var handler = new SocketsHttpHandler();