Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-64718

Windows: QUdpSocket::readDatagram sender address is not assigned

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 5.9.3
    • Fix Version/s: 5.9.4
    • Component/s: Network: Sockets
    • Labels:
      None
    • Commits:
      6a9d076e87f0c8aa4fb49bbcc2f56eefd85af2e3

      Description

      When updating from Qt 5.9.2 to 5.9.3 today, our UDP based network protocol stopped working on Windows 8.1!

      The reason is that QUdpSocket::readDatagram() does not assign the sender address any more.

      Here is some example code that fails with 5.9.3:

      QHostAddress sender;
      QByteArray datagram;
      datagram.resize( m_requestSocket->pendingDatagramSize());
      m_requestSocket->readDatagram( datagram.data(), datagram.size(), &sender);
      qDebug() << "sender:" << sender.isNull() << sender;
      processHeartbeat( datagram, sender);
      
      // output: 
      sender: true QHostAddress("")

      So sender.isNull() returns true, which should not be possible!

      The same code is still working on Linux and Android.

      Fortunately using QUdpSocket::receiveDatagram() instead seems to be working.

       

        Attachments

          Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Activity

              People

              • Assignee:
                thiago Thiago Macieira
                Reporter:
                seek Bernhard Hartleb
              • Votes:
                6 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes