diff options
author | Vijay Pai <vpai@google.com> | 2015-05-04 14:38:14 -0700 |
---|---|---|
committer | Vijay Pai <vpai@google.com> | 2015-05-04 14:38:14 -0700 |
commit | 25aa12fa758c9f85280e88feb73a4c78a902adc3 (patch) | |
tree | 43eaa4712599ea4a98eef1d6cb2ffa71a2f8c117 | |
parent | 6dc550287163b7a1ac31808418a8102d794cc238 (diff) |
Support multi-stream synchronous client tests
-rw-r--r-- | test/cpp/qps/client_sync.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/cpp/qps/client_sync.cc b/test/cpp/qps/client_sync.cc index 0809eb5b6c..be3d73844f 100644 --- a/test/cpp/qps/client_sync.cc +++ b/test/cpp/qps/client_sync.cc @@ -97,10 +97,10 @@ class SynchronousUnaryClient GRPC_FINAL : public SynchronousClient { class SynchronousStreamingClient GRPC_FINAL : public SynchronousClient { public: SynchronousStreamingClient(const ClientConfig& config): - SynchronousClient(config) { + SynchronousClient(config), context_(num_threads_) { for (size_t thread_idx=0;thread_idx<num_threads_;thread_idx++){ auto* stub = channels_[thread_idx % channels_.size()].get_stub(); - stream_ = stub->StreamingCall(&context_); + stream_ = stub->StreamingCall(&context_[thread_idx]); } StartThreads(num_threads_); } @@ -122,7 +122,7 @@ class SynchronousStreamingClient GRPC_FINAL : public SynchronousClient { return false; } private: - grpc::ClientContext context_; + std::vector<grpc::ClientContext> context_; std::unique_ptr<grpc::ClientReaderWriter<SimpleRequest, SimpleResponse>> stream_; }; |