enable tcp_nodelay option

This commit is contained in:
Eduardo Bart 2011-11-08 21:03:17 -02:00
parent 6a17173d08
commit 9c55f18186
1 changed files with 5 additions and 0 deletions

View File

@ -149,6 +149,11 @@ void Connection::onConnect(const boost::system::error_code& error)
if(!error) { if(!error) {
m_connected = true; m_connected = true;
// disable nagle's algorithm
boost::asio::ip::tcp::no_delay option(true);
m_socket.set_option(option);
if(m_connectCallback) if(m_connectCallback)
g_dispatcher.addEvent(m_connectCallback); g_dispatcher.addEvent(m_connectCallback);
} else } else