mirror of https://github.com/Icinga/icinga2.git
Merge pull request #6901 from Icinga/bugfix/so_reuseport-6898
TcpSocket#Bind(): also set SO_REUSEPORT
This commit is contained in:
commit
77572c4424
|
@ -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…
Reference in New Issue