diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/cpp/server/server_builder.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/cpp/server/server_builder.cc b/src/cpp/server/server_builder.cc index fa158c919e..86c78f05ff 100644 --- a/src/cpp/server/server_builder.cc +++ b/src/cpp/server/server_builder.cc @@ -51,21 +51,21 @@ std::unique_ptr<ServerCompletionQueue> ServerBuilder::AddCompletionQueue() { } void ServerBuilder::RegisterService(SynchronousService* service) { - services_.emplace_back(service->service()); + services_.emplace_back(new NamedService<RpcService>(service->service())); } void ServerBuilder::RegisterAsyncService(AsynchronousService* service) { - async_services_.emplace_back(service); + async_services_.emplace_back(new NamedService<AsynchronousService>(service)); } void ServerBuilder::RegisterService( const grpc::string& addr, SynchronousService* service) { - services_.emplace_back(addr, service->service()); + services_.emplace_back(new NamedService<RpcService>(addr, service->service())); } void ServerBuilder::RegisterAsyncService( const grpc::string& addr, AsynchronousService* service) { - async_services_.emplace_back(addr, service); + async_services_.emplace_back(new NamedService<AsynchronousService>(addr, service)); } void ServerBuilder::RegisterAsyncGenericService(AsyncGenericService* service) { @@ -107,13 +107,13 @@ std::unique_ptr<Server> ServerBuilder::BuildAndStart() { } for (auto service = services_.begin(); service != services_.end(); service++) { - if (!server->RegisterService(service->host.get(), service->service)) { + if (!server->RegisterService((*service)->host.get(), (*service)->service)) { return nullptr; } } for (auto service = async_services_.begin(); service != async_services_.end(); service++) { - if (!server->RegisterAsyncService(service->host.get(), service->service)) { + if (!server->RegisterAsyncService((*service)->host.get(), (*service)->service)) { return nullptr; } } |