|
|
|
@ -119,10 +119,9 @@ class ClientReader final : public ClientStreamingInterface, |
|
|
|
|
buf.AddRecvInitialMetadata(&context_->recv_initial_metadata_); |
|
|
|
|
context_->initial_metadata_received_ = true; |
|
|
|
|
} |
|
|
|
|
bool got_message; |
|
|
|
|
buf.AddRecvMessage(msg, &got_message); |
|
|
|
|
buf.AddRecvMessage(msg); |
|
|
|
|
call_.PerformOps(&buf); |
|
|
|
|
return cq_.Pluck(&buf) && got_message; |
|
|
|
|
return cq_.Pluck(&buf) && buf.got_message; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
virtual Status Finish() override { |
|
|
|
@ -174,11 +173,10 @@ class ClientWriter final : public ClientStreamingInterface, |
|
|
|
|
virtual Status Finish() override { |
|
|
|
|
CallOpBuffer buf; |
|
|
|
|
Status status; |
|
|
|
|
bool got_message; |
|
|
|
|
buf.AddRecvMessage(response_, &got_message); |
|
|
|
|
buf.AddRecvMessage(response_); |
|
|
|
|
buf.AddClientRecvStatus(&context_->trailing_metadata_, &status); |
|
|
|
|
call_.PerformOps(&buf); |
|
|
|
|
GPR_ASSERT(cq_.Pluck(&buf) && got_message); |
|
|
|
|
GPR_ASSERT(cq_.Pluck(&buf) && buf.got_message); |
|
|
|
|
return status; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -225,10 +223,9 @@ class ClientReaderWriter final : public ClientStreamingInterface, |
|
|
|
|
buf.AddRecvInitialMetadata(&context_->recv_initial_metadata_); |
|
|
|
|
context_->initial_metadata_received_ = true; |
|
|
|
|
} |
|
|
|
|
bool got_message; |
|
|
|
|
buf.AddRecvMessage(msg, &got_message); |
|
|
|
|
buf.AddRecvMessage(msg); |
|
|
|
|
call_.PerformOps(&buf); |
|
|
|
|
return cq_.Pluck(&buf) && got_message; |
|
|
|
|
return cq_.Pluck(&buf) && buf.got_message; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
virtual bool Write(const W& msg) override { |
|
|
|
@ -277,10 +274,9 @@ class ServerReader final : public ReaderInterface<R> { |
|
|
|
|
|
|
|
|
|
virtual bool Read(R* msg) override { |
|
|
|
|
CallOpBuffer buf; |
|
|
|
|
bool got_message; |
|
|
|
|
buf.AddRecvMessage(msg, &got_message); |
|
|
|
|
buf.AddRecvMessage(msg); |
|
|
|
|
call_->PerformOps(&buf); |
|
|
|
|
return call_->cq()->Pluck(&buf) && got_message; |
|
|
|
|
return call_->cq()->Pluck(&buf) && buf.got_message; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private: |
|
|
|
@ -338,10 +334,9 @@ class ServerReaderWriter final : public WriterInterface<W>, |
|
|
|
|
|
|
|
|
|
virtual bool Read(R* msg) override { |
|
|
|
|
CallOpBuffer buf; |
|
|
|
|
bool got_message; |
|
|
|
|
buf.AddRecvMessage(msg, &got_message); |
|
|
|
|
buf.AddRecvMessage(msg); |
|
|
|
|
call_->PerformOps(&buf); |
|
|
|
|
return call_->cq()->Pluck(&buf) && got_message; |
|
|
|
|
return call_->cq()->Pluck(&buf) && buf.got_message; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
virtual bool Write(const W& msg) override { |
|
|
|
@ -420,7 +415,7 @@ class ClientAsyncReader final : public ClientAsyncStreamingInterface, |
|
|
|
|
read_buf_.AddRecvInitialMetadata(&context_->recv_initial_metadata_); |
|
|
|
|
context_->initial_metadata_received_ = true; |
|
|
|
|
} |
|
|
|
|
read_buf_.AddRecvMessage(msg, nullptr); |
|
|
|
|
read_buf_.AddRecvMessage(msg); |
|
|
|
|
call_.PerformOps(&read_buf_); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -484,7 +479,7 @@ class ClientAsyncWriter final : public ClientAsyncStreamingInterface, |
|
|
|
|
finish_buf_.AddRecvInitialMetadata(&context_->recv_initial_metadata_); |
|
|
|
|
context_->initial_metadata_received_ = true; |
|
|
|
|
} |
|
|
|
|
finish_buf_.AddRecvMessage(response_, nullptr); |
|
|
|
|
finish_buf_.AddRecvMessage(response_); |
|
|
|
|
finish_buf_.AddClientRecvStatus(&context_->trailing_metadata_, status); |
|
|
|
|
call_.PerformOps(&finish_buf_); |
|
|
|
|
} |
|
|
|
@ -529,7 +524,7 @@ class ClientAsyncReaderWriter final : public ClientAsyncStreamingInterface, |
|
|
|
|
read_buf_.AddRecvInitialMetadata(&context_->recv_initial_metadata_); |
|
|
|
|
context_->initial_metadata_received_ = true; |
|
|
|
|
} |
|
|
|
|
read_buf_.AddRecvMessage(msg, nullptr); |
|
|
|
|
read_buf_.AddRecvMessage(msg); |
|
|
|
|
call_.PerformOps(&read_buf_); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|