I am using sync api with C++.

Here is how on server side I am checking if the client has stopped the 
stream.

grpc::Status AuthServer::ConnectServiceImpl::HearthBeat(grpc::ServerContext 
*context,
grpc::ServerReaderWriter<Pulse, Pulse> *stream) {
Pulse note;
if(ctx_.IsCancelled()){
std::cout << "DISCONNECT" << std::endl;
    }
while (stream->Read(&note)) {
Pulse reply;
reply.set_rate(note.rate()+1);
std::cout << "RECEIVED: " << note.rate() << std::endl;
stream->Write(reply);
}

return grpc::Status::OK;
}

This is bidi stream which is stopped forcefully on client side with killing 
the client app and still the "DISCONNECT" message does not appear.

Why is that, am I using `IsCancelled()` not correctly?

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/75c3600d-a713-4b3b-b1c7-6920a0183997n%40googlegroups.com.

Reply via email to