Removed possibly unnecessary is_tcp_fast_open_supported-function

This commit is contained in:
eidheim 2019-01-10 12:57:38 +01:00
commit b7e5a37da4
2 changed files with 2 additions and 26 deletions

View file

@ -401,11 +401,10 @@ namespace SimpleWeb {
acceptor = std::unique_ptr<asio::ip::tcp::acceptor>(new asio::ip::tcp::acceptor(*io_service));
acceptor->open(endpoint.protocol());
acceptor->set_option(asio::socket_base::reuse_address(config.reuse_address));
if (config.fast_open && is_tcp_fast_open_supported(connection_mode::server))
{
if(config.fast_open) {
#if defined(__linux__) && defined(TCP_FASTOPEN)
const int qlen = 5; // This seems to be the value that is used in other examples.
error_code ec{};
error_code ec;
acceptor->set_option(asio::detail::socket_option::integer<IPPROTO_TCP, TCP_FASTOPEN>(qlen), ec);
#endif // End Linux
}