Do you want to know how your customers use your applications and devices? Try Qt Insight Beta.
最新版Qt 6.3已正式发布。 了解更多。
最新バージョンQt 6.3がご利用いただけます。 詳細はこちら

IPv6 changes in Qt5

As you might know, Qt has had support for IPv6 since quite some time.
Now we have made some changes in Qt5 that relate to IPv6:

Shane has improved the support for binding TCP and UDP sockets. Originally there was QHostAddress::Any which meant any IPv4 ( Then at some point QHostAddress::AnyIPv6 was introduced to mean any IPv6. We changed this a bit: Now QHostAddress::Any means any IPv4/IPv6 and there is a new enum QHostAddress::AnyIPv4 that stands for

Martin has implemented a variant of the "Happy Eyeballs" IPv6 connection mechanism inside QNetworkAccessManager's HTTP code.
This is a temporary measure that we'll use for connecting to web servers. If the OS indicates support for both IPv4 and IPv6 and has connectivity for both, we will try to connect with IPv4 and IPv6 if we get both types of DNS records for this HTTP server.
Whichever address family connects first will then be used for all further connections to this server. The goal here is to deal with the possibility that IPv6/IPv4 packets get eaten up somewhere and we'd have timeouts and a bad user experience because of that.

To further express that we take IPv6 seriously, I also have removed the support to compile with QT_NO_IPV6. I think that every platform that Qt5 will run on also has support for IPv6.

We also haven't forgotten the 4.8 branch. It will bring IPv6 support for Qt/Symbian. Stay tuned for that, I heard there should be a beta real soon now.

Blog Topics: