aboutsummaryrefslogtreecommitdiffhomepage
path: root/examples/cpp/helloworld/greeter_async_server.cc
diff options
context:
space:
mode:
Diffstat (limited to 'examples/cpp/helloworld/greeter_async_server.cc')
-rw-r--r--examples/cpp/helloworld/greeter_async_server.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/examples/cpp/helloworld/greeter_async_server.cc b/examples/cpp/helloworld/greeter_async_server.cc
index 64e065b1e4..ead44182e5 100644
--- a/examples/cpp/helloworld/greeter_async_server.cc
+++ b/examples/cpp/helloworld/greeter_async_server.cc
@@ -160,7 +160,9 @@ class ServerImpl final {
// 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);
+ // The return value of Next should always be checked. This return value
+ // tells us whether there is any kind of event or cq_ is shutting down.
+ GPR_ASSERT(cq_->Next(&tag, &ok));
GPR_ASSERT(ok);
static_cast<CallData*>(tag)->Proceed();
}