diff --git a/cpp/helloworld/greeter_server.cc b/cpp/helloworld/greeter_server.cc index 01a0bf242dd..e3dd36b0ed9 100644 --- a/cpp/helloworld/greeter_server.cc +++ b/cpp/helloworld/greeter_server.cc @@ -34,7 +34,6 @@ #include #include #include -#include #include #include @@ -69,9 +68,7 @@ void RunServer() { builder.RegisterService(&service); std::unique_ptr server(builder.BuildAndStart()); std::cout << "Server listening on " << server_address << std::endl; - while (true) { - std::this_thread::sleep_for(std::chrono::seconds(5)); - } + server->Wait(); } int main(int argc, char** argv) {