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 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/76b84113-8de9-4475-a483-c20a1b83cb87%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
