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

Windows: QUdpSocket::readDatagram sender address is not assigned

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.9.4
    • 5.9.3
    • Network: Sockets
    • None
    • 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

              thiago Thiago Macieira
              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