mirror of
https://github.com/wassname/ray.git
synced 2026-07-15 11:25:40 +08:00
Set TCP_NODELAY on all TCP connections (#4318)
This commit is contained in:
committed by
Philipp Moritz
parent
f423909aec
commit
edc794751f
@@ -12,6 +12,12 @@ namespace ray {
|
||||
|
||||
ray::Status TcpConnect(boost::asio::ip::tcp::socket &socket,
|
||||
const std::string &ip_address_string, int port) {
|
||||
// Disable Nagle's algorithm, which caused transfer delays of 10s of ms in
|
||||
// certain cases.
|
||||
socket.open(boost::asio::ip::tcp::v4());
|
||||
boost::asio::ip::tcp::no_delay option(true);
|
||||
socket.set_option(option);
|
||||
|
||||
boost::asio::ip::address ip_address =
|
||||
boost::asio::ip::address::from_string(ip_address_string);
|
||||
boost::asio::ip::tcp::endpoint endpoint(ip_address, port);
|
||||
|
||||
Reference in New Issue
Block a user