Change to server.Wait() api.
This commit is contained in:
parent
de0c653ed5
commit
50bc9a77f8
|
|
@ -37,7 +37,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>
|
||||||
|
|
@ -191,9 +190,7 @@ void RunServer(const std::string& db_path) {
|
||||||
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) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue