CreateChannel API change syncup and regenerate files

pull/3109/head
Yang Gao 10 years ago
parent 798695f81c
commit 7c968086a9
  1. 2
      cpp/helloworld/greeter_client.cc
  2. 8
      cpp/helloworld/helloworld.pb.cc
  3. 4
      cpp/helloworld/helloworld.pb.h

@ -80,7 +80,7 @@ int main(int argc, char** argv) {
grpc_init(); grpc_init();
GreeterClient greeter( GreeterClient greeter(
grpc::CreateChannel("localhost:50051", ChannelArguments())); grpc::CreateChannelDeprecated("localhost:50051", ChannelArguments()));
std::string user("world"); std::string user("world");
std::string reply = greeter.SayHello(user); std::string reply = greeter.SayHello(user);
std::cout << "Greeter received: " << reply << std::endl; std::cout << "Greeter received: " << reply << std::endl;

@ -590,8 +590,8 @@ static const char* Greeter_method_names[] = {
"/helloworld.Greeter/SayHello", "/helloworld.Greeter/SayHello",
}; };
Greeter::Stub* Greeter::NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel) { std::unique_ptr< Greeter::Stub> Greeter::NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel) {
Greeter::Stub* stub = new Greeter::Stub(); std::unique_ptr< Greeter::Stub> stub(new Greeter::Stub());
stub->set_channel(channel); stub->set_channel(channel);
return stub; return stub;
}; };
@ -600,8 +600,8 @@ Greeter::Stub* Greeter::NewStub(const std::shared_ptr< ::grpc::ChannelInterface>
return ::grpc::BlockingUnaryCall(channel(),::grpc::RpcMethod(Greeter_method_names[0]), context, request, response); return ::grpc::BlockingUnaryCall(channel(),::grpc::RpcMethod(Greeter_method_names[0]), context, request, response);
} }
::grpc::ClientAsyncResponseReader< ::helloworld::HelloReply>* Greeter::Stub::SayHello(::grpc::ClientContext* context, const ::helloworld::HelloRequest& request, ::grpc::CompletionQueue* cq, void* tag) { std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::helloworld::HelloReply>> Greeter::Stub::SayHello(::grpc::ClientContext* context, const ::helloworld::HelloRequest& request, ::grpc::CompletionQueue* cq, void* tag) {
return new ::grpc::ClientAsyncResponseReader< ::helloworld::HelloReply>(channel(), cq, ::grpc::RpcMethod(Greeter_method_names[0]), context, request, tag); return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::helloworld::HelloReply>>(new ::grpc::ClientAsyncResponseReader< ::helloworld::HelloReply>(channel(), cq, ::grpc::RpcMethod(Greeter_method_names[0]), context, request, tag));
} }
Greeter::AsyncService::AsyncService(::grpc::CompletionQueue* cq) : ::grpc::AsynchronousService(cq, Greeter_method_names, 1) {} Greeter::AsyncService::AsyncService(::grpc::CompletionQueue* cq) : ::grpc::AsynchronousService(cq, Greeter_method_names, 1) {}

@ -320,9 +320,9 @@ class Greeter final {
class Stub final : public ::grpc::InternalStub { class Stub final : public ::grpc::InternalStub {
public: public:
::grpc::Status SayHello(::grpc::ClientContext* context, const ::helloworld::HelloRequest& request, ::helloworld::HelloReply* response); ::grpc::Status SayHello(::grpc::ClientContext* context, const ::helloworld::HelloRequest& request, ::helloworld::HelloReply* response);
::grpc::ClientAsyncResponseReader< ::helloworld::HelloReply>* SayHello(::grpc::ClientContext* context, const ::helloworld::HelloRequest& request, ::grpc::CompletionQueue* cq, void* tag); std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::helloworld::HelloReply>> SayHello(::grpc::ClientContext* context, const ::helloworld::HelloRequest& request, ::grpc::CompletionQueue* cq, void* tag);
}; };
static Stub* NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel); static std::unique_ptr<Stub> NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel);
class Service : public ::grpc::SynchronousService { class Service : public ::grpc::SynchronousService {
public: public:

Loading…
Cancel
Save