Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Inconsistent QHostAddress behavior

Inconsistent QHostAddress behavior

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 140 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Taytoo
    wrote on last edited by Taytoo
    #1

    I have a QTcpSocket client that connects with a Remote (on Internet) tcp server. When I call socket.localAddress().toString() immediately after WaitforConnected call. It returns local/lan IP in format ::ffff:192.168.1.54 (IPv4 mapped IPv6). However, if I call it later after some data transfer then same call returns 192.168.1.54 (standard IPv4 format). After first call, QHostAddress.protocol() returns IPv6Protocol and after second call QHostAddress.protocol() returns IPv4Protocol.

    Remote server and local server are both using IPv4 addresses and my ISP doesn't support IPv6, so why is the first response in IPv6 format? How to get correct format?

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved