mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-07 05:44:28 +02:00
TcpSocket#Bind(): also set SO_REUSEPORT
refs #6898 (cherry picked from commit 984f7be03060f89235ccee1a1ef3e5fba652a9df)
This commit is contained in:
parent
f6a62e71d8
commit
362c7eb28a
@ -91,6 +91,9 @@ void TcpSocket::Bind(const String& node, const String& service, int family)
|
||||
|
||||
const int optTrue = 1;
|
||||
setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, reinterpret_cast<const char *>(&optTrue), sizeof(optTrue));
|
||||
#ifndef _WIN32
|
||||
setsockopt(fd, SOL_SOCKET, SO_REUSEPORT, reinterpret_cast<const char *>(&optTrue), sizeof(optTrue));
|
||||
#endif /* _WIN32 */
|
||||
|
||||
int rc = bind(fd, info->ai_addr, info->ai_addrlen);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user