ping
A connection-level liveness check that works while streams are in flight.
ping(request?: Partial<PingRequest>): Promise<PongResponse>Parameters
ParameterTypeRequired
clientTimestampUnixNanos64-bit integeroptionalDefaults to now, so a call with no argument is the normal one. Compare it against the pong's timestamps to measure round-trip time.
Returns
FieldTypePresence
—PongResponsealwaysThe server's reply, carrying its own timestamps.
Wire tier only
There is no HTTP ping. The HTTP client holds no connection, so there is nothing to keep alive — use whoami if you want a cheap reachability check over HTTP.
A pooled connection outlives any single request, so a server restart leaves
every borrower holding the same dead socket. ping detects that; the pool's
health-checking accessor fixes it. See
Wire client.
See also
Was this page helpful?