void HandleRpcs() {
// Spawn a new CallData instance to serve new clients.
new CallData(&service_, cq_.get());
void* tag; // uniquely identifies a request.
bool ok;
while (true) {
// Block waiting to read the next event from the completion queue. The
// event is uniquely identified by its tag, which in this case is the
// memory address of a CallData instance.
cq_->Next(&tag, &ok);
GPR_ASSERT(ok);
static_cast<CallData*>(tag)->Proceed();
}
}
--
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 grpc-io+unsubscribe@googlegroups.com.
To post to this group, send email to grp...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/d8490d01-8a6d-4ad8-b27c-9170363298cc%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+u...@googlegroups.com.
To post to this group, send email to grp...@googlegroups.com.
How would I add code here that does service_->RequestSayGoodbye is what I'm after.
To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+unsubscribe@googlegroups.com.
To post to this group, send email to grp...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+u...@googlegroups.com.
To post to this group, send email to grp...@googlegroups.com.
In CallData constructor we call RequestSayHello with the cq and the this pointer of the CallData as the tag. This means we are asking for grpc server to give back a new SayHello rpc call on cq, and when the call comes, that tag will be returned. That is the reason why we can cast the tag we get back from the cq to a CallData. If you have another method, you need to explicitly call RequestSayGoodbye and give it a unique tag. When you get back the tag from the completion queue, you know you have a SayGoodbye call.