'gRPC client keeps crashing when reading server stream

I am following the ListFeatures() example in this tutorial: https://github.com/grpc/grpc/blob/v1.31.0/examples/cpp/route_guide/route_guide_client.cc

My server is in Java and my client application is in c++.

I have both the server and the client running locally. What I am observing is that my application crashes when I try to read the stream response via `reader->Read(&feature). I can verify that the server receives the api call and is sending responses back. I am also able to successfully hit the server from bloomRPC.

Any ideas why I can't receive responses in my c++ client application?

Much appreciated!



Solution 1:[1]

I had this problem when the context used to create the ClientReader fell out of scope. The context needs to be persistent while the ClientReader is in use.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Ted