Just a minor improvement to the patch I submitted.
Cheers,
Aaron
--- jacktrip-1.1~repack/src/JackTrip.cpp	2019-09-02 07:57:44.000000000 +1000
+++ JackTrip.cpp	2019-09-02 07:58:29.098016907 +1000
@@ -450,7 +450,16 @@
   UdpSockTemp.readDatagram(buf, 1, &peerHostAddress, &peer_port);
   UdpSockTemp.close(); // close the socket
 
-  mPeerAddress = peerHostAddress.toString();
+  // Convert any IPv4-mapped address to an actual IPv4 address
+  // (Due to a change in the way that QHostAddress works in Qt5)
+  bool couldConvert;
+  QHostAddress ipv4Address(peerHostAddress.toIPv4Address(&couldConvert));
+  if (couldConvert) {
+    mPeerAddress = ipv4Address.toString();
+  } else {
+    mPeerAddress = peerHostAddress.toString();
+  }
+
   cout << "Client Connection Received from IP : " 
        << qPrintable(mPeerAddress) << endl;
   cout << gPrintSeparator << endl;

Reply via email to