Skip to content
Permalink
Browse files

Fix ipv6_server=true not accepting IPv4 connections on Windows (#7471)

  • Loading branch information...
sfan5 authored and SmallJoker committed Jun 22, 2018
1 parent b308cb6 commit c66d97726931aa8dde7d8a1ffa5b8e41234f4660
Showing with 9 additions and 0 deletions.
  1. +9 −0 src/network/socket.cpp
@@ -118,6 +118,15 @@ bool UDPSocket::init(bool ipv6, bool noExceptions)

setTimeoutMs(0);

if (m_addr_family == AF_INET6) {
// Allow our socket to accept both IPv4 and IPv6 connections
// required on Windows:
// https://msdn.microsoft.com/en-us/library/windows/desktop/bb513665(v=vs.85).aspx
int value = 0;
setsockopt(m_handle, IPPROTO_IPV6, IPV6_V6ONLY,
reinterpret_cast<char *>(&value), sizeof(value));
}

return true;
}

0 comments on commit c66d977

Please sign in to comment.
You can’t perform that action at this time.