SocketEngine Windows: If not dual stack, use IPv4 for AnyIPProtocol

If the Windows version doesn't support dual stack then we should bind
to IPv4. So we should change the socketProtocol to
QAbstractSocket::IPv4Protocol as well.

Change-Id: I7f9d0bdd861f82d720e347d3fa968198de720d1a
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
This commit is contained in:
Martin Petersson 2012-07-03 10:46:36 +02:00 committed by Qt by Nokia
parent ee4f50b2e7
commit 4d145e3ffa

View File

@ -793,7 +793,10 @@ bool QNativeSocketEnginePrivate::nativeBind(const QHostAddress &a, quint16 port)
ipv6only = ::setsockopt(socketDescriptor, IPPROTO_IPV6, IPV6_V6ONLY, (char*)&ipv6only, sizeof(ipv6only) );
else
#endif
{
address = QHostAddress(QHostAddress::AnyIPv4); //xp/WS2003 and earlier don't support dual stack, so bind to IPv4
socketProtocol = QAbstractSocket::IPv4Protocol;
}
break;
default:
break;