mirror of https://github.com/Icinga/icinga2.git
apilistener: Make SO_REUSEPORT optional
This commit is contained in:
parent
2ab08a8d96
commit
b5fa7569f2
|
@ -386,9 +386,9 @@ bool ApiListener::AddListener(const String& node, const String& service)
|
||||||
|
|
||||||
const int optTrue = 1;
|
const int optTrue = 1;
|
||||||
setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, reinterpret_cast<const char *>(&optTrue), sizeof(optTrue));
|
setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, reinterpret_cast<const char *>(&optTrue), sizeof(optTrue));
|
||||||
#ifndef _WIN32
|
#ifdef SO_REUSEPORT
|
||||||
setsockopt(fd, SOL_SOCKET, SO_REUSEPORT, reinterpret_cast<const char *>(&optTrue), sizeof(optTrue));
|
setsockopt(fd, SOL_SOCKET, SO_REUSEPORT, reinterpret_cast<const char *>(&optTrue), sizeof(optTrue));
|
||||||
#endif /* _WIN32 */
|
#endif /* SO_REUSEPORT */
|
||||||
}
|
}
|
||||||
|
|
||||||
acceptor->bind(current->endpoint());
|
acceptor->bind(current->endpoint());
|
||||||
|
|
Loading…
Reference in New Issue