|
|
@ -281,7 +281,8 @@ class AsyncStreamingClient GRPC_FINAL : public Client { |
|
|
|
|
|
|
|
|
|
|
|
int t = 0; |
|
|
|
int t = 0; |
|
|
|
for (int i = 0; i < config.outstanding_rpcs_per_channel(); i++) { |
|
|
|
for (int i = 0; i < config.outstanding_rpcs_per_channel(); i++) { |
|
|
|
for (auto &channel : channels_) { |
|
|
|
for (auto channel = channels_.begin(); channel != channels_.end(); |
|
|
|
|
|
|
|
channel++) { |
|
|
|
auto* cq = cli_cqs_[t].get(); |
|
|
|
auto* cq = cli_cqs_[t].get(); |
|
|
|
t = (t + 1) % cli_cqs_.size(); |
|
|
|
t = (t + 1) % cli_cqs_.size(); |
|
|
|
auto start_req = [cq](TestService::Stub *stub, grpc::ClientContext *ctx, |
|
|
|
auto start_req = [cq](TestService::Stub *stub, grpc::ClientContext *ctx, |
|
|
@ -290,7 +291,7 @@ class AsyncStreamingClient GRPC_FINAL : public Client { |
|
|
|
return stream; |
|
|
|
return stream; |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
TestService::Stub *stub = channel.get_stub(); |
|
|
|
TestService::Stub *stub = channel->get_stub(); |
|
|
|
const SimpleRequest &request = request_; |
|
|
|
const SimpleRequest &request = request_; |
|
|
|
new ClientRpcContextStreamingImpl<SimpleRequest, SimpleResponse>( |
|
|
|
new ClientRpcContextStreamingImpl<SimpleRequest, SimpleResponse>( |
|
|
|
stub, request, start_req, check_done); |
|
|
|
stub, request, start_req, check_done); |
|
|
@ -303,11 +304,11 @@ class AsyncStreamingClient GRPC_FINAL : public Client { |
|
|
|
~AsyncStreamingClient() GRPC_OVERRIDE { |
|
|
|
~AsyncStreamingClient() GRPC_OVERRIDE { |
|
|
|
EndThreads(); |
|
|
|
EndThreads(); |
|
|
|
|
|
|
|
|
|
|
|
for (auto &cq : cli_cqs_) { |
|
|
|
for (auto cq = cli_cqs_.begin(); cq != cli_cqs_.end(); cq++) { |
|
|
|
cq->Shutdown(); |
|
|
|
(*cq)->Shutdown(); |
|
|
|
void *got_tag; |
|
|
|
void *got_tag; |
|
|
|
bool ok; |
|
|
|
bool ok; |
|
|
|
while (cq->Next(&got_tag, &ok)) { |
|
|
|
while ((*cq)->Next(&got_tag, &ok)) { |
|
|
|
delete ClientRpcContext::detag(got_tag); |
|
|
|
delete ClientRpcContext::detag(got_tag); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|