Enable SO_REUSEPORT on Linux as well as OS X
This commit is contained in:
parent
db7b1bdd69
commit
50ac462471
1 changed files with 2 additions and 2 deletions
|
|
@ -136,7 +136,7 @@ namespace fc {
|
||||||
FC_ASSERT(my->_sock.is_open());
|
FC_ASSERT(my->_sock.is_open());
|
||||||
boost::asio::socket_base::reuse_address option(enable);
|
boost::asio::socket_base::reuse_address option(enable);
|
||||||
my->_sock.set_option(option);
|
my->_sock.set_option(option);
|
||||||
#if defined(__APPLE__)
|
#if defined(__APPLE__) || (defined(__linux__) && defined(SO_REUSEPORT))
|
||||||
// OSX needs SO_REUSEPORT in addition to SO_REUSEADDR.
|
// OSX needs SO_REUSEPORT in addition to SO_REUSEADDR.
|
||||||
// This probably needs to be set for any BSD
|
// This probably needs to be set for any BSD
|
||||||
int reuseport_value = 1;
|
int reuseport_value = 1;
|
||||||
|
|
@ -195,7 +195,7 @@ namespace fc {
|
||||||
my = new impl;
|
my = new impl;
|
||||||
boost::asio::ip::tcp::acceptor::reuse_address option(enable);
|
boost::asio::ip::tcp::acceptor::reuse_address option(enable);
|
||||||
my->_accept.set_option(option);
|
my->_accept.set_option(option);
|
||||||
#if defined(__APPLE__)
|
#if defined(__APPLE__) || (defined(__linux__) && defined(SO_REUSEPORT))
|
||||||
// OSX needs SO_REUSEPORT in addition to SO_REUSEADDR.
|
// OSX needs SO_REUSEPORT in addition to SO_REUSEADDR.
|
||||||
// This probably needs to be set for any BSD
|
// This probably needs to be set for any BSD
|
||||||
int reuseport_value = 1;
|
int reuseport_value = 1;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue