19 #include <condition_variable>
28 #include "examples/protos/helloworld.grpc.pb.h"
30 #include "helloworld.grpc.pb.h"
61 std::condition_variable
cv;
67 std::lock_guard<std::mutex> lock(
mu);
72 std::unique_lock<std::mutex> lock(
mu);
79 return reply.message();
81 std::cout <<
status.error_code() <<
": " <<
status.error_message()
88 std::unique_ptr<Greeter::Stub>
stub_;
91 int main(
int argc,
char** argv) {
101 size_t start_pos = arg_val.find(arg_str);
102 if (start_pos != std::string::npos) {
103 start_pos += arg_str.size();
104 if (arg_val[start_pos] ==
'=') {
105 target_str = arg_val.substr(start_pos + 1);
107 std::cout <<
"The only correct argument syntax is --target="
112 std::cout <<
"The only acceptable argument is --target=" << std::endl;
116 target_str =
"localhost:50051";
122 std::cout <<
"Greeter received: " << reply << std::endl;