mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-23 13:45:04 +02:00
Merge pull request #6405 from Icinga/bugfix/windows-reload-behaviour-6378
TcpSocket#Bind(): reuse socket addresses on Windows, too
This commit is contained in:
commit
ba680dc829
@ -89,10 +89,8 @@ void TcpSocket::Bind(const String& node, const String& service, int family)
|
|||||||
const int optFalse = 0;
|
const int optFalse = 0;
|
||||||
setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, reinterpret_cast<const char *>(&optFalse), sizeof(optFalse));
|
setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, reinterpret_cast<const char *>(&optFalse), sizeof(optFalse));
|
||||||
|
|
||||||
#ifndef _WIN32
|
|
||||||
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));
|
||||||
#endif /* _WIN32 */
|
|
||||||
|
|
||||||
int rc = bind(fd, info->ai_addr, info->ai_addrlen);
|
int rc = bind(fd, info->ai_addr, info->ai_addrlen);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user