18 instantiations of SocketsHttpHandler
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 (3)
EventSourceTests.cs (1)
166using var socketsHandler = new SocketsHttpHandler()
Http2\Http2EndToEndTests.cs (1)
49using var socketsHandler = new SocketsHttpHandler()
KestrelMetricsTests.cs (1)
357using 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 (1)
ResponseHeaderTests.cs (1)
128var socketsHttpHandler = new SocketsHttpHandler() { ResponseHeaderEncodingSelector = (_, _) => Encoding.UTF8 };
Microsoft.Extensions.Http (2)
DefaultHttpMessageHandlerBuilder.cs (1)
69SocketsHttpHandler handler = new();
DependencyInjection\HttpClientBuilderExtensions.cs (1)
295handler = new SocketsHttpHandler();
Sockets.FunctionalTests (1)
src\Servers\Kestrel\test\FunctionalTests\Http2\ShutdownTests.cs (1)
38var handler = new SocketsHttpHandler
System.Net.Http (1)
System\Net\Http\HttpClientHandler.cs (1)
63_underlyingHandler = new HttpHandlerType();
System.Net.Requests (1)
System\Net\HttpWebRequest.cs (1)
1663var handler = new SocketsHttpHandler();
System.Net.WebSockets.Client (2)
System\Net\WebSockets\WebSocketHandle.Managed.cs (2)
261var invoker = new HttpMessageInvoker(new SocketsHttpHandler() 279var handler = new SocketsHttpHandler();
71 references to SocketsHttpHandler
HttpClientApp (1)
Program.cs (1)
12var handler = new SocketsHttpHandler();
HttpStress (1)
Program.cs (1)
512var handler = new SocketsHttpHandler()
InMemory.FunctionalTests (3)
EventSourceTests.cs (1)
166using var socketsHandler = new SocketsHttpHandler()
Http2\Http2EndToEndTests.cs (1)
49using var socketsHandler = new SocketsHttpHandler()
KestrelMetricsTests.cs (1)
357using 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 (1)
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)
270/// Adds or updates <see cref="SocketsHttpHandler"/> as a primary handler for a named <see cref="HttpClient"/>. If provided, 271/// also adds a delegate that will be used to configure the primary <see cref="SocketsHttpHandler"/>. 274/// <param name="configureHandler">Optional delegate that is used to configure the primary <see cref="SocketsHttpHandler"/>.</param> 278/// If a primary handler was already set to be <see cref="SocketsHttpHandler"/> by previously calling, for example, 281/// delegate will be applied to the existing instance. Otherwise, a new instance of <see cref="SocketsHttpHandler"/> will be created. 285public static IHttpClientBuilder UseSocketsHttpHandler(this IHttpClientBuilder builder, Action<SocketsHttpHandler, IServiceProvider>? configureHandler = null) 293if (b.PrimaryHandler is not SocketsHttpHandler handler) 306/// Adds or updates <see cref="SocketsHttpHandler"/> as a primary handler for a named <see cref="HttpClient"/> 310/// <param name="configureBuilder">Delegate that is used to set up the configuration of the the primary <see cref="SocketsHttpHandler"/> 315/// If a primary handler was already set to be <see cref="SocketsHttpHandler"/> by previously calling, for example, 319/// <see cref="SocketsHttpHandler"/> will be created.
DependencyInjection\ISocketsHttpHandlerBuilder.cs (1)
8/// A builder for configuring <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() && builder.PrimaryHandler is SocketsHttpHandler socketsHttpHandler)
Sockets.FunctionalTests (1)
src\Servers\Kestrel\test\FunctionalTests\Http2\ShutdownTests.cs (1)
38var handler = new SocketsHttpHandler
System.Net.Http (13)
System\Net\Http\HttpClientHandler.cs (6)
18using HttpHandlerType = System.Net.Http.SocketsHttpHandler; 25private readonly HttpHandlerType _underlyingHandler; 56private HttpHandlerType Handler => _underlyingHandler; 79public virtual bool SupportsAutomaticDecompression => HttpHandlerType.SupportsAutomaticDecompression; 80public virtual bool SupportsProxy => HttpHandlerType.SupportsProxy; 81public 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)
656Trace($"{nameof(SocketsHttpHandler.ConnectCallback)} completing asynchronously for a synchronous request."); 733Trace($"{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. 456/// Gets or sets the <see cref="IMeterFactory"/> to create a custom <see cref="Meter"/> for the <see cref="SocketsHttpHandler"/> instance. 459/// 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)
1663var handler = new SocketsHttpHandler(); 1678var settings = typeof(SocketsHttpHandler).GetField("_settings", BindingFlags.NonPublic | BindingFlags.Instance)?.GetValue(handler);
System.Net.WebSockets.Client (1)
System\Net\WebSockets\WebSocketHandle.Managed.cs (1)
279var handler = new SocketsHttpHandler();