Skip to content
Snippets Groups Projects
Commit eff91095 authored by Craig Tiller's avatar Craig Tiller
Browse files

Merge pull request #388 from vjpai/master

Add write buffer hint to C++ server handlers so that writes actually go out as expected
parents bf5b2610 280744ec
No related branches found
No related tags found
No related merge requests found
......@@ -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.");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment