Merge pull request #388 from vjpai/master

Add write buffer hint to C++ server handlers so that writes actually go out as expected
pull/375/merge
Craig Tiller 10 years ago
commit eff91095cf
  1. 2
      src/cpp/server/async_server_context.cc
  2. 2
      src/cpp/server/server_rpc_handler.cc

@ -54,7 +54,7 @@ AsyncServerContext::~AsyncServerContext() { grpc_call_destroy(call_); }
void AsyncServerContext::Accept(grpc_completion_queue *cq) {
GPR_ASSERT(grpc_call_server_accept_old(call_, cq, this) == GRPC_CALL_OK);
GPR_ASSERT(grpc_call_server_end_initial_metadata_old(call_, 0) ==
GPR_ASSERT(grpc_call_server_end_initial_metadata_old(call_, GRPC_WRITE_BUFFER_HINT) ==
GRPC_CALL_OK);
}

@ -77,7 +77,7 @@ void ServerRpcHandler::StartRpc() {
if (status.IsOk()) {
// Send the response if we get an ok status.
async_server_context_->StartWrite(*response, 0);
async_server_context_->StartWrite(*response, GRPC_WRITE_BUFFER_HINT);
type = WaitForNextEvent();
if (type != CompletionQueue::SERVER_WRITE_OK) {
status = Status(StatusCode::INTERNAL, "Error writing response.");

Loading…
Cancel
Save