1# gRPC C++ Wait-For-Ready Example 2 3The Wait-For-Ready example builds on the 4[Hello World Example](https://github.com/grpc/grpc/tree/master/examples/cpp/helloworld) 5and changes the gRPC client and server to show how to set wait-for-ready. 6 7For more information on wait-for-ready in gRPC, please refer to 8[gRPC Wait For Ready Semantics](https://github.com/grpc/grpc/blob/master/doc/wait-for-ready.md). 9 10## Running the example 11 12First run the client - 13 14``` 15$ tools/bazel run examples/cpp/wait_for_ready:greeter_callback_client 16``` 17 18On running this, we'll see 10 RPCs failed due to "Connection refused" errors. 19These RPCs did not have WAIT_FOR_READY set, resulting in the RPCs not waiting 20for the channel to be connected. 21 22The next 10 RPCs have WAIT_FOR_READY set, so the client will be waiting for the 23channel to be ready before progressing. 24 25Now, on a separate terminal, run the server - 26 27``` 28$ tools/bazel run examples/cpp/helloworld:greeter_callback_server 29``` 30 31The client channel should now be able to connect to the server, and the RPCs 32should succeed. 33