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. Multicast with QUdpSocket and QHostAddress::Any does not work
Forum Updated to NodeBB v4.3 + New Features

Multicast with QUdpSocket and QHostAddress::Any does not work

Scheduled Pinned Locked Moved General and Desktop
qudpsocketmulticast
8 Posts 2 Posters 4.3k Views 2 Watching
  • 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.
  • K Offline
    K Offline
    kzawada
    wrote on last edited by kzawada
    #1

    For some reason I just recently ran into an issue with this.

    I configure the bind the following way:
    m_udpSocket.bind(QHostAddress::Any, 2222);

    then eventually when I want to respond to a message I call:
    qint64 dataWritten = poUdpSocketIo->writeDatagram(Data, qhaIPv4Addr, 2222);

    a qDebug() message is printed that showns:
    SUCCESS on writeDatagram() | dataWritten: 128 | Data.size(): 128

    However, when I use Wireshark I can see that this message never goes out on the wire.

    If I change the bind call to the following:
    m_udpSocket.bind(QHostAddress("192.168.100.3"), 2222);

    This multicast works perfectly fine and I can see packets being sent to multicast address 239.192.1.65.

    I have another computer setup with Windows 7 just like this failing one and I can see that even with QHostAddress::Any this still works.

    What could be wrong? Why is the multicast not working when the bind() call is passed QHostAddress::Any when it used to work and it works this way on another computer?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      On what OS/Qt combo do you have the failure ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      K 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        On what OS/Qt combo do you have the failure ?

        K Offline
        K Offline
        kzawada
        wrote on last edited by
        #3

        @SGaist I am running on Windows 7 Professional Service Pack 1 (64-bit Operating System). Also tried with both Qt 5.4.1 32-bit and Qt 5.3.1 32-bit.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          And it's falling only on that one computer ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          K 1 Reply Last reply
          0
          • SGaistS SGaist

            And it's falling only on that one computer ?

            K Offline
            K Offline
            kzawada
            wrote on last edited by
            #5

            @SGaist Yes, it used to work on that computer previously.

            The only difference I have noticed so far it he following output using command prompt:

            FAILING COMPUTER

            C:\>netsh interface ip show join "Local Area Connection"
            
            Interface 11: Local Area Connection
            
            
            Multicast Address : 224.0.0.1
            Scope             : 0
            References        : 0
            Last Reporter?    : Yes
            
            Multicast Address : 224.0.0.252
            Scope             : 0
            References        : 1
            Last Reporter?    : Yes
            
            Multicast Address : 239.255.255.250
            Scope             : 0
            References        : 2
            Last Reporter?    : Yes
            
            
            C:\>
            

            WORKING COMPUTER

            C:\>netsh interface ip show join "Local Area Connection"
            
            Interface 13: Local Area Connection
            
            
            Multicast Address : 224.0.0.1
            Scope             : 0
            References        : 0
            Last Reporter?    : Yes
            
            
            C:\>
            

            I'm not sure if it is because the failing computer is showing two more Multicast Addressed. In which case I don't know how to remove the other two addresses.

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Got several network cards ?

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              K 1 Reply Last reply
              0
              • SGaistS SGaist

                Got several network cards ?

                K Offline
                K Offline
                kzawada
                wrote on last edited by
                #7

                @SGaist No just one.

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  Did you check with the latest Qt 5.5 if you still experience this behavior ?

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  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