diff options
author | murgatroid99 <michael.lumish@gmail.com> | 2015-01-26 11:34:16 -0800 |
---|---|---|
committer | murgatroid99 <michael.lumish@gmail.com> | 2015-01-26 11:34:16 -0800 |
commit | 8111654e8befff8d1ace4b994ea7b5e21dcd72aa (patch) | |
tree | ef1e2fd09b437c983635d3f530d1ddc1c5d1d653 | |
parent | 51cab624b8fda39ad1a5709d817f5d82f0edbcd5 (diff) | |
parent | a50867d0e81d94eeb8c267c71462d04fa50282df (diff) |
Merge branch 'master' of github.com:google/grpc into node_fix_test_hang
-rw-r--r-- | examples/tips/client.h | 5 | ||||
-rw-r--r-- | examples/tips/client_main.cc | 17 |
2 files changed, 13 insertions, 9 deletions
diff --git a/examples/tips/client.h b/examples/tips/client.h index 3f4f1fd836..6ae9d50658 100644 --- a/examples/tips/client.h +++ b/examples/tips/client.h @@ -31,6 +31,9 @@ * */ +#ifndef __GRPCPP_EXAMPLES_TIPS_CLIENT_H_ +#define __GRPCPP_EXAMPLES_TIPS_CLIENT_H_ + #include <grpc++/channel_interface.h> #include <grpc++/status.h> @@ -52,3 +55,5 @@ class Client { } // namespace tips } // namespace examples } // namespace grpc + +#endif // __GRPCPP_EXAMPLES_TIPS_CLIENT_H_ diff --git a/examples/tips/client_main.cc b/examples/tips/client_main.cc index 17567b6f17..f4a3b09601 100644 --- a/examples/tips/client_main.cc +++ b/examples/tips/client_main.cc @@ -41,30 +41,29 @@ #include "examples/tips/client.h" #include "test/cpp/util/create_test_channel.h" -DEFINE_bool(enable_ssl, true, "Whether to use ssl/tls."); -DEFINE_bool(use_prod_roots, true, "True to use SSL roots for production GFE"); -DEFINE_int32(server_port, 0, "Server port."); -DEFINE_string(server_host, "127.0.0.1", "Server host to connect to"); -DEFINE_string(server_host_override, "foo.test.google.com", - "Override the server host which is sent in HTTP header"); +DEFINE_int32(server_port, 443, "Server port."); +DEFINE_string(server_host, + "pubsub-staging.googleapis.com", "Server host to connect to"); int main(int argc, char** argv) { grpc_init(); google::ParseCommandLineFlags(&argc, &argv, true); gpr_log(GPR_INFO, "Start TIPS client"); - GPR_ASSERT(FLAGS_server_port); const int host_port_buf_size = 1024; char host_port[host_port_buf_size]; snprintf(host_port, host_port_buf_size, "%s:%d", FLAGS_server_host.c_str(), FLAGS_server_port); std::shared_ptr<grpc::ChannelInterface> channel( - grpc::CreateTestChannel(host_port, FLAGS_server_host_override, - FLAGS_enable_ssl, FLAGS_use_prod_roots)); + grpc::CreateTestChannel(host_port, + FLAGS_server_host, + true, // enable SSL + true)); // use prod roots grpc::examples::tips::Client client(channel); grpc::Status s = client.CreateTopic("test"); + gpr_log(GPR_INFO, "return code %d", s.code()); GPR_ASSERT(s.IsOk()); channel.reset(); |