Change to server.Wait()

This commit is contained in:
Yang Gao 2015-02-24 15:59:43 -08:00
parent 7c968086a9
commit 2b4be223d3
1 changed files with 1 additions and 4 deletions

View File

@ -34,7 +34,6 @@
#include <iostream> #include <iostream>
#include <memory> #include <memory>
#include <string> #include <string>
#include <thread>
#include <grpc/grpc.h> #include <grpc/grpc.h>
#include <grpc++/server.h> #include <grpc++/server.h>
@ -69,9 +68,7 @@ void RunServer() {
builder.RegisterService(&service); builder.RegisterService(&service);
std::unique_ptr<Server> server(builder.BuildAndStart()); std::unique_ptr<Server> server(builder.BuildAndStart());
std::cout << "Server listening on " << server_address << std::endl; std::cout << "Server listening on " << server_address << std::endl;
while (true) { server->Wait();
std::this_thread::sleep_for(std::chrono::seconds(5));
}
} }
int main(int argc, char** argv) { int main(int argc, char** argv) {