diff options
author | Max Kellermann <max@musicpd.org> | 2017-08-10 13:23:14 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2017-08-10 13:23:14 +0200 |
commit | d2cdaa041cf9759f7e133663beab505ccee8e05a (patch) | |
tree | 792753aaefbc0a394d6ad4a674d7bfc4ba82e9be /src/net | |
parent | d84dae488e7080495898bc24dea95d5b173873c2 (diff) |
net/SocketDescriptor: SO_REUSEADDR is portable
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/SocketDescriptor.cxx | 4 | ||||
-rw-r--r-- | src/net/SocketDescriptor.hxx | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/net/SocketDescriptor.cxx b/src/net/SocketDescriptor.cxx index e0cf9d56a..9a3b97c9d 100644 --- a/src/net/SocketDescriptor.cxx +++ b/src/net/SocketDescriptor.cxx @@ -206,14 +206,14 @@ SocketDescriptor::SetOption(int level, int name, return setsockopt(fd, level, name, (const char *)value, size) == 0; } -#ifdef __linux__ - bool SocketDescriptor::SetReuseAddress(bool value) { return SetBoolOption(SOL_SOCKET, SO_REUSEADDR, value); } +#ifdef __linux__ + #ifdef SO_REUSEPORT bool diff --git a/src/net/SocketDescriptor.hxx b/src/net/SocketDescriptor.hxx index d439e7068..33785cd8c 100644 --- a/src/net/SocketDescriptor.hxx +++ b/src/net/SocketDescriptor.hxx @@ -141,8 +141,9 @@ public: return SetOption(level, name, &value, sizeof(value)); } -#ifdef __linux__ bool SetReuseAddress(bool value=true); + +#ifdef __linux__ bool SetReusePort(bool value=true); bool SetFreeBind(bool value=true); bool SetNoDelay(bool value=true); |