IPV6_V6ONLY needs to be disabled on cygwin too.

This commit is contained in:
Bartosz Taudul 2017-09-23 20:20:41 +02:00
parent e1a63dbb53
commit c0b1846a35

View File

@ -217,8 +217,8 @@ bool ListenSocket::Listen( const char* port, int backlog )
if( getaddrinfo( nullptr, port, &hints, &res ) != 0 ) return false; if( getaddrinfo( nullptr, port, &hints, &res ) != 0 ) return false;
m_sock = socket( res->ai_family, res->ai_socktype, res->ai_protocol ); m_sock = socket( res->ai_family, res->ai_socktype, res->ai_protocol );
#ifdef _MSC_VER #if defined _MSC_VER || defined __CYGWIN__
DWORD val = 0; unsigned long val = 0;
setsockopt( m_sock, IPPROTO_IPV6, IPV6_V6ONLY, (const char*)&val, sizeof( val ) ); setsockopt( m_sock, IPPROTO_IPV6, IPV6_V6ONLY, (const char*)&val, sizeof( val ) );
#endif #endif
if( bind( m_sock, res->ai_addr, res->ai_addrlen ) == -1 ) return false; if( bind( m_sock, res->ai_addr, res->ai_addrlen ) == -1 ) return false;