Hi all,
I am using "A server-side streaming RPC where the client sends a request to the server and gets a stream to read a sequence of messages back. " mode:
rpc transaction(request) returns (stream response) {}
My current Client cod's logic is: if find response message format error, doesn't receive the rest message, call the ClientReader's Finish() function:
while (reader->Read(&response)) {
The Server's code is simple, just for-loop write all responses:
for (...) {
writer->Write(response);
}
But I find if Client doesn't read all responses, the "reader->Finish();" will block forever. So my current solution is even the response has error, Client still need to
read all responses.
So my question is what is the correct method to only process half of the stream response? Must read all responses?
Thanks very much in advance!
Best Reagrds
Nan Xiao