KeepAlive

Available in a dev version: 0․11․0-grpc-186

How to configure

Represents keep-alive settings for a gRPC client connection.

Keep-alive ensures that the connection between the client and the server remains active. It helps detect connection issues proactively before a request is made and facilitates maintaining long-lived idle connections.

Client authors must coordinate with service owners for whether a particular client-side setting is acceptable.

Properties

Link copied to clipboard

Specifies the maximum amount of time the channel can remain idle before a keep-alive ping is sent to the server to check the connection state. The default value is Duration.INFINITE, which disables keep-alive pings when idle.

Link copied to clipboard

Sets the amount of time to wait for a keep-alive ping response. If the server does not respond within this timeout, the connection will be considered broken. The default value is 20 seconds.

Link copied to clipboard

Defines whether keep-alive pings will be sent even when there are no active RPCs on the connection. If set to true, pings will be sent regardless of ongoing calls; otherwise, pings are only sent during active RPCs. The default value is false.