MCPcopy Create free account
hub / github.com/0xUnixIO/pulse / keepaliveParams

Function keepaliveParams

internal/nodeagent/agent.go:227–233  ·  view source on GitHub ↗

keepaliveParams 返回 grpc.WithKeepaliveParams 选项。 PermitWithoutStream=true 让 client 在没有 active stream 时也能维持 ping, 与 server 的 EnforcementPolicy.PermitWithoutStream=true 配合,配合 reaper 实现死连接快速发现。

(cfg Config)

Source from the content-addressed store, hash-verified

225// 与 server 的 EnforcementPolicy.PermitWithoutStream=true 配合,配合 reaper
226// 实现死连接快速发现。
227func keepaliveParams(cfg Config) grpc.DialOption {
228 return grpc.WithKeepaliveParams(keepalive.ClientParameters{
229 Time: cfg.KeepaliveTime,
230 Timeout: cfg.KeepaliveTimeout,
231 PermitWithoutStream: true,
232 })
233}

Callers 1

RunFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected