]> granicus.if.org Git - icinga2/commitdiff
TcpSocket#Bind(): reuse socket addresses on Windows, too 6405/head
authorAlexander A. Klimov <alexander.klimov@icinga.com>
Fri, 22 Jun 2018 08:33:31 +0000 (10:33 +0200)
committerAlexander A. Klimov <alexander.klimov@icinga.com>
Fri, 22 Jun 2018 08:33:31 +0000 (10:33 +0200)
refs #6378

lib/base/tcpsocket.cpp

index a25d52d77889dd5e72dc127c06fef9a9fad5399a..0af189f8bcc7cd0611c4de7ec8e99ed1e3b0cda9 100644 (file)
@@ -89,10 +89,8 @@ void TcpSocket::Bind(const String& node, const String& service, int family)
                const int optFalse = 0;
                setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, reinterpret_cast<const char *>(&optFalse), sizeof(optFalse));
 
-#ifndef _WIN32
                const int optTrue = 1;
                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);