简体   繁体   中英

gRpc sending heartbeat - client/server

I am very new to gRpc and have started exploring their basics(in C#). I would like to get guidance on how we can send heart beats to check if client/server is still connected and take recovery actions in case they are disconnected. Any example or reference to any documents/articles will be helpful to get me started. Thanks!

Have a look at the gRPCHealth Checking Protocol .

It's a straightforward protobuf that describes a mechanism by which a client can check whether a server is available and whether services hosted on the server are healthy. The service includes a Watch method that provides heatbeats.

You could extend eg the Watch method or the HealthCheckRequest message with a periodicity property to provide clients with a way to define the frequency of messages they require.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM