From: Alexander A. Klimov Date: Fri, 22 Jun 2018 08:33:31 +0000 (+0200) Subject: TcpSocket#Bind(): reuse socket addresses on Windows, too X-Git-Tag: v2.9.0~16^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=refs%2Fpull%2F6405%2Fhead;p=icinga2 TcpSocket#Bind(): reuse socket addresses on Windows, too refs #6378 --- diff --git a/lib/base/tcpsocket.cpp b/lib/base/tcpsocket.cpp index a25d52d77..0af189f8b 100644 --- a/lib/base/tcpsocket.cpp +++ b/lib/base/tcpsocket.cpp @@ -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(&optFalse), sizeof(optFalse)); -#ifndef _WIN32 const int optTrue = 1; setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, reinterpret_cast(&optTrue), sizeof(optTrue)); -#endif /* _WIN32 */ int rc = bind(fd, info->ai_addr, info->ai_addrlen);