diff --git a/examples/cpp/helloworld/greeter_async_client.cc b/examples/cpp/helloworld/greeter_async_client.cc index ab02bbc478a..72c3d47c222 100644 --- a/examples/cpp/helloworld/greeter_async_client.cc +++ b/examples/cpp/helloworld/greeter_async_client.cc @@ -64,15 +64,8 @@ class GreeterClient { // Storage for the status of the RPC upon completion. Status status; - // stub_->PrepareAsyncSayHello() creates an RPC object, returning - // an instance to store in "call" but does not actually start the RPC - // Because we are using the asynchronous API, we need to hold on to - // the "call" instance in order to get updates on the ongoing RPC. std::unique_ptr > rpc( - stub_->PrepareAsyncSayHello(&context, request, &cq)); - - // StartCall initiates the RPC call - rpc->StartCall(); + stub_->AsyncSayHello(&context, request, &cq)); // Request that, upon completion of the RPC, "reply" be updated with the // server's response; "status" with the indication of whether the operation