Commit 67b3f891 authored by Giel van Schijndel's avatar Giel van Schijndel
Browse files

Disable Nagle on TCP socket: too slow for interactive

The wire-protocol is latency-bound, not bandwidth-constrained. So
disable the Nagle algorithm to prevent large delays from hurting our
performance too much.

NOTE: Considering that we are implementing a request-reply protocol it
might be possible to improve performance without disabling the Nagle
algorithm. E.g. by taking control over buffering ourselves instead of
leaving it up to the iostream class.
parent 9b3225f4
......@@ -13,6 +13,7 @@ void SocketServer::listen(const port_type port) {
tcp::endpoint endpoint(tcp::v4(), port);
acceptor.open(endpoint.protocol());
acceptor.set_option(tcp::acceptor::reuse_address(true));
acceptor.set_option(tcp::no_delay(true));
acceptor.bind(endpoint);
acceptor.listen(1);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment