Hi Carl, C++, thanks! Best Regards Nan Xiao
On Wed, Oct 4, 2017 at 8:47 AM, 'Carl Mastrangelo' via grpc.io <[email protected]> wrote: > What language are you using? > > On Wednesday, September 27, 2017 at 11:13:18 PM UTC-7, [email protected] > wrote: >> >> 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)) { >> if (response is error) { >> break; >> } >> } >> >> reader->Finish(); >> >> >> 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 > > -- > You received this message because you are subscribed to a topic in the > Google Groups "grpc.io" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/grpc-io/R0NTqKaHLdE/unsubscribe. > To unsubscribe from this group and all its topics, 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/76b84113-8de9-4475-a483-c20a1b83cb87%40googlegroups.com. > > For more options, visit https://groups.google.com/d/optout. -- 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/CA%2BMhoaOj-CPSEHgHTEgDOnGNuHZtJEFSc0WkhUs%2BLjr-PFVs%3Dg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
