The meaning of ok is documented at https://github.com/grpc/grpc/blob/be1ce0c4ccbf17ebeee9b7b057d40ff4e12f3479/include/grpcpp/impl/codegen/completion_queue.h#L122-L169 . In particular, note that the meaning of ok depends on the type of operation that is being pulled by the Next operation, so it is perfectly normal to get a "true" ok after a "false" ok, depending on the type of operation being delivered.
For your question: with an async server, the way to tell if the client-side is fully failed or just did a WritesDone is to use an AsyncNotifyWhenDone operation on your ServerContext. After that tag comes through, you can check if the RPC was canceled. The WritesDone would just make a Read operation return false but won't finish the RPC the way a failure or cancellation would. On Thursday, October 18, 2018 at 3:09:19 AM UTC-7, Lingzi Peng wrote: > > Hi, > > I am writing a program with sync streaming client (ClientWriter) and async > server. > > During the debug, i found that when ClientWriter called WritesDone, > cq->next call in server side has ok = false returned. > > And after writesDone, client side call Finish, this time cq->next call in > server side has ok = true. > > In that case, is there any way to differentiate if the ok = false is > caused by that client side has quit unexpectedly or a WritesDone was > called? Since in both cases ok = false. > > > Cheers > > > -- 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/92740eb7-bf7c-4a6c-87e8-bc218cfd9d85%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
