Hi,
Can you help me understand how did you overcome this issue. I too have a
client that invokes streaming rpc and it gets blocked in ClientReader::Read.
I cant set a timeout as it would mean the rpc needs to be invoked again
after the timeout.
I need a way to reestablish the server connection if client gets blocked in
ClientReader::Read. I cannot read the connection state as the call is
blocked.
However Read fails and gets unblocked if
- I kill the server process or unplug the connection between client and
server
But the client gets blocked indefinitely when the server is
shutdown/powered off.
My code goes like this....
ClientContext context;
std::unique_ptr<Consumer::Stub> stub_ = Consumer::NewStub(channel);
ThreadEventReader = stub_->GetDataStream(&context, Filter); //rpc call
// blocked read - until stream closed
while (ThreadEventReader->Read(&StreamedData))
{
cout << "UpdateStream: " << StreamedData.displayvalue() <<
endl;
}
On Wednesday, 25 May 2016 10:29:57 UTC-5, [email protected] wrote:
>
> Hi, my version has fail_fast, and I checked the state of channel. When
> server is shutdown, the state is GRPC_CHANNEL_CONNECTING, which helps me
> know server is unavailable.
> Thank you!
>
--
You received this message because you are subscribed to the Google Groups
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit
https://groups.google.com/d/msgid/grpc-io/6655a757-e39a-43c0-8bac-a556170d5eae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.