From 1430d5909a9deb8bd80792027064404afd07fced Mon Sep 17 00:00:00 2001 From: James Newton-King Date: Thu, 18 Apr 2024 16:04:57 +0800 Subject: [PATCH 1/2] Enable multiple connections with WinHttpHandler by default --- src/Shared/HttpHandlerFactory.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Shared/HttpHandlerFactory.cs b/src/Shared/HttpHandlerFactory.cs index bafc8b36f..8a2a1f801 100644 --- a/src/Shared/HttpHandlerFactory.cs +++ b/src/Shared/HttpHandlerFactory.cs @@ -38,7 +38,12 @@ public static HttpMessageHandler CreatePrimaryHandler() #endif #if NET462 - return new WinHttpHandler(); + // Create SocketsHttpHandler with EnableMultipleHttp2Connections set to true. That will + // allow a gRPC channel to create new connections if the maximum allow concurrency is exceeded. + return new WinHttpHandler + { + EnableMultipleHttp2Connections = true + }; #elif !NETSTANDARD2_0 return new HttpClientHandler(); #else From d23dca8925c66f51876f715a4675430d11d220fd Mon Sep 17 00:00:00 2001 From: James Newton-King Date: Thu, 18 Apr 2024 16:05:23 +0800 Subject: [PATCH 2/2] Comment --- src/Shared/HttpHandlerFactory.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Shared/HttpHandlerFactory.cs b/src/Shared/HttpHandlerFactory.cs index 8a2a1f801..6d0661c7c 100644 --- a/src/Shared/HttpHandlerFactory.cs +++ b/src/Shared/HttpHandlerFactory.cs @@ -38,7 +38,7 @@ public static HttpMessageHandler CreatePrimaryHandler() #endif #if NET462 - // Create SocketsHttpHandler with EnableMultipleHttp2Connections set to true. That will + // Create WinHttpHandler with EnableMultipleHttp2Connections set to true. That will // allow a gRPC channel to create new connections if the maximum allow concurrency is exceeded. return new WinHttpHandler {