I implemented a long-lived stream service:
class McaPwrBtnService final : public peripheral::PowerButton::CallbackService
The rpc is implemented like:
grpc::ServerWriteReactor<peripheral::KeyEvent>* McaPwrBtnService::listenForKeyEvents( ::grpc::CallbackServerContext* ctx, const ::google::protobuf::Empty*)
{
class Listener : public grpc::ServerWriteReactor<peripheral::KeyEvent> {
As long only one client is connected everything works fine.
When the client exits, ServerWriteReactor::OnCancel gets called
When a second client connects, ServerWriteReactor::OnCancel never gets called anymore, when the both clients terminate. Further more, from that moment on, the server doesn’t accept any RPCs anymore.
If checked my code several times, compared it with the examples.
Couldn’t find anything wrong.
My questions:
- is my approach wrong?
- Could this be a gRPC bug?
BR
Nik
user24707800 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.