Skip to content

Commit a80ee30

Browse files
Add keep alive in http2
1 parent 8f4ee45 commit a80ee30

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/KubernetesClient/Kubernetes.ConfigInit.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,12 @@ private void CreateHttpClient(DelegatingHandler[] handlers, KubernetesClientConf
192192
//
193193
// Should remove after better solution
194194

195-
var sh = new SocketsHttpHandler();
195+
var sh = new SocketsHttpHandler
196+
{
197+
KeepAlivePingPolicy = HttpKeepAlivePingPolicy.WithActiveRequests,
198+
KeepAlivePingDelay = TimeSpan.FromMinutes(3),
199+
KeepAlivePingTimeout = TimeSpan.FromSeconds(30)
200+
};
196201
sh.ConnectCallback = async (context, token) =>
197202
{
198203
var socket = new Socket(SocketType.Stream, ProtocolType.Tcp)

0 commit comments

Comments
 (0)