Add http2 keep alive in watch (#781)

This commit is contained in:
Zhiwei Liu
2022-02-17 09:18:45 +00:00
committed by GitHub
parent 408610fce8
commit 29f9aa9df4

View File

@@ -192,7 +192,12 @@ namespace k8s
// //
// Should remove after better solution // Should remove after better solution
var sh = new SocketsHttpHandler(); var sh = new SocketsHttpHandler
{
KeepAlivePingPolicy = HttpKeepAlivePingPolicy.WithActiveRequests,
KeepAlivePingDelay = TimeSpan.FromMinutes(3),
KeepAlivePingTimeout = TimeSpan.FromSeconds(30),
};
sh.ConnectCallback = async (context, token) => sh.ConnectCallback = async (context, token) =>
{ {
var socket = new Socket(SocketType.Stream, ProtocolType.Tcp) var socket = new Socket(SocketType.Stream, ProtocolType.Tcp)