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

UDP Socket bind works only partly on Windows Vista (64Bit)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.0.1
    • 5.0.0
    • Network: Sockets
    • None
    • Qt 5.0.0 X-compiled on Gentoo Linux for mingw64, Windows Vista 64Bit as test environment.
    • e3bd06426afce9773fa64afe1a9946647cdec181

    Description

      The broadcast receiver example is not able to bind the socket.

      This is the original code:
      udpSocket = new QUdpSocket(this);
      udpSocket->bind(45454, QUdpSocket::ShareAddress);

      To show the problem, I changed the source like this:
      udpSocket = new QUdpSocket(this);
      if(!udpSocket->bind(45454, QUdpSocket::ShareAddress))
      qDebug() << "cannot bind !!!";

      This variant is working:
      udpSocket = new QUdpSocket(this);
      if(!udpSocket->bind(QHostAddress::AnyIPv4, 45454, QUdpSocket::ShareAddress))
      qDebug() << "cannot bind !!!";

      It seems that the problem is related to the changed behavior of the QHostAddress::Any enum.

      Attachments

        Issue Links

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

          Activity

            People

              shkearns Shane Kearns
              dreyero Olaf Dreyer
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes