MCPcopy
hub / github.com/grpc/grpc-go / WithKeepaliveParams

Function WithKeepaliveParams

dialoptions.go:575–583  ·  dialoptions.go::WithKeepaliveParams

WithKeepaliveParams returns a DialOption that specifies keepalive parameters for the client transport. Keepalive is disabled by default.

(kp keepalive.ClientParameters)

Source from the content-addressed store, hash-verified

573//
574// Keepalive is disabled by default.
575func WithKeepaliveParams(kp keepalive.ClientParameters) DialOption {
576 if kp.Time < internal.KeepaliveMinPingTime {
577 logger.Warningf("Adjusting keepalive ping interval to minimum period of %v", internal.KeepaliveMinPingTime)
578 kp.Time = internal.KeepaliveMinPingTime
579 }
580 return newFuncDialOption(func(o *dialOptions) {
581 o.copts.KeepaliveParams = kp
582 })
583}
584
585// WithUnaryInterceptor returns a DialOption that specifies the interceptor for
586// unary RPCs.

Callers 8

DialFunction · 0.92
makeClientsFunction · 0.92
BuildMethod · 0.92
mainFunction · 0.92

Calls 2

newFuncDialOptionFunction · 0.85
WarningfMethod · 0.65