Skip to content

Commit 29f9aa9

Browse files
authored
Add http2 keep alive in watch (#781)
1 parent 408610f commit 29f9aa9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/KubernetesClient/Kubernetes.ConfigInit.cs

+6-1
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)