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. Make setSocketOption + QAbstractSocket::MulticastTtlOption work!

Make setSocketOption + QAbstractSocket::MulticastTtlOption work!

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 1.8k Views 1 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.
  • R Offline
    R Offline
    ruehlchr
    wrote on last edited by
    #1

    Hi Guys,

    I have a small project working and debug the ttl of a multicast udp datagram using tcpdump.
    Its turns out that the
    setSocketOption(QAbstractSocket::MulticastTtlOption,QVariant(4)) has no effect
    tcpdump shows ttl=1

    I'd followed the sample code:
    http://qt-project.org/doc/qt-4.8/network-multicastsender-sender-cpp.html

    Here my finding:
    not work:
    udpSocket = new QUdpSocket(this);
    udpSocket->setSocketOption(QAbstractSocket::MulticastTtlOption, QVariant(4));

    11:38:41.994031 IP (tos 0x0, ttl 1, id 6402, offset 0, flags [DF], proto UDP (17), length 37)
    10.128.2.32.59388 > 239.255.43.21.45454: [udp sum ok] UDP, length 9

    work:
    DCMCASTPORT=45454
    udpSocket = new QUdpSocket(this);
    udpSocket->bind(DCMCASTPORT);
    udpSocket->setSocketOption(QAbstractSocket::MulticastTtlOption, QVariant(4));

    12:15:43.285005 IP (tos 0x0, ttl 4, id 57649, offset 0, flags [DF], proto UDP (17), length 37)
    10.128.2.32.57081 > 239.255.43.21.45454: [udp sum ok] UDP, length 9

    May this find the way into the demo code.

    Happy Hacking!
    Chris

    If you want to make it fly. QTit!

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

      Hi,

      From the forum it's pretty unlikely that it'l get to the example code however if you would like to update the example, you can provide a patch and contribute it to Qt

      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