Skip to content

Commit

Permalink
[coro_rpc][improve]set tcp nodelay (#646)
Browse files Browse the repository at this point in the history
  • Loading branch information
qicosmos authored Mar 22, 2024
1 parent 3b73dfa commit b8e130c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/ylt/coro_rpc/impl/coro_rpc_client.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,8 @@ class coro_rpc_client {
co_return errc::timed_out;
}

socket_->set_option(asio::ip::tcp::no_delay(true), ec);

#ifdef YLT_ENABLE_SSL
if (!config_.ssl_cert_path.empty()) {
assert(ssl_stream_);
Expand Down
1 change: 1 addition & 0 deletions include/ylt/coro_rpc/impl/coro_rpc_server.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ class coro_rpc_server_base {

int64_t conn_id = ++conn_id_;
ELOGV(INFO, "new client conn_id %d coming", conn_id);
socket.set_option(asio::ip::tcp::no_delay(true), error);
auto conn = std::make_shared<coro_connection>(executor, std::move(socket),
conn_timeout_duration_);
conn->set_quit_callback(
Expand Down

0 comments on commit b8e130c

Please sign in to comment.