Why does QHostAddress::protocol() always return QAbstractSocket::IPv6Protocol
Unsolved
General and Desktop
-
When I establish IPv4 connection between a QTcpSocket and a QTcpServer, I find out that the socket.peerAddress().toString() returns a IPv6 version of IPv4 address, which is like ::ffff:192.168.1.100. And then I check the socket.peerAddress().protocol() and it returns QAbstractSocket::IPv6Protocol. Why does it return an IPv6 when I am using IPv4?
-
Hi,
AFAICS, your system is using a IPV4 mapped IPV6. So technically there's nothing wrong going on from a Qt point of view. The IPV4/IPV6 handling is done outside of Qt's scope and you get accurate information.
-
AFAIK, it should be yes.