path: root/src/network/kernel/qhostaddress.h
diff options
authorShane Kearns <>2011-06-07 14:38:38 +0100
committerQt by Nokia <>2011-06-22 11:01:00 +0200
commit85136496bc8517951dcc3e670d1a46d340819f0d (patch)
tree86ca9423d926ed2f85744f4159966549f454e8f8 /src/network/kernel/qhostaddress.h
parent665d8a045455214d2cfca72076da6bc75d3058c7 (diff)
IPv4 + IPv6 dual stack sockets
Adds support for binding "dual stack" sockets (via QUdpSocket or QTcpServer). A dual stack socket will accept incoming connections on either IPv4 or IPv6 interfaces. QHostAddress::Any - use this to bind a dual stack socket QHostAddress::AnyIPv6 - use this to bind a socket for IPv6 only QHostAddress::AnyIPv4 - use this to bind a socket for IPv4 only Binding to a specific address rather than one of the "any" addresses is restricting you to a protocol anyway so no behaviour change there. IPv6 sockets were previously dual stack on some OS and v6 only on others Any previously meant IPv4 only This commit implemented & tested on Windows 7, Linux (Ubuntu 10.04) and Mac OS 10.6.7. Windows XP and server 2003 do not support dual stack sockets, even though they can support IPv6. On those versions, QHostAddress::Any will still bind to IPv4 (which is also the behaviour anywhere QT_NO_IPV6 is defined) Autotests run: qudpsocket (includes a new test case) qtcpserver (includes a new test case) qtcpsocket qnetworkreply qhostaddress Task-number: QTBUG-17080 Change-Id: Id486677c4f832e18dc0ff1a86c5f5fc422c9eb4f Reviewed-on: Reviewed-by: Qt Sanity Bot <> Reviewed-by: Thiago Macieira <> Reviewed-by: Markus Goetz
Diffstat (limited to 'src/network/kernel/qhostaddress.h')
1 files changed, 2 insertions, 1 deletions
diff --git a/src/network/kernel/qhostaddress.h b/src/network/kernel/qhostaddress.h
index 486f2322ae..efb3198fc0 100644
--- a/src/network/kernel/qhostaddress.h
+++ b/src/network/kernel/qhostaddress.h
@@ -76,7 +76,8 @@ public:
- AnyIPv6
+ AnyIPv6,
+ AnyIPv4