[Interest] QUdpSocket multicast on multiple network interfaces

Tom Isaacson Tom.Isaacson at navico.com
Thu Feb 20 05:54:57 CET 2014

>> We're using Qt 4.8.2 on an embedded Linux device. We've always had 
>> Ethernet
>> (eth0) and we use QUdpSocket to send a multicast message on the network:
>>     m_pUdpSocket = new QUdpSocket(this);
>>     m_pUdpSocket->writeDatagram(json.toAscii(), m_cMulticastAddr, 
>> m_cMulticastPort);

>It's working as intended. That's how IP works (both v4 and v6).

But if the Ethernet and Wifi are bridged shouldn't Qt multicast to both?

>Did you use joinMulticastGroup? Or do you just want to send to the group, but not receive from it? If so, did you use setMulticastInterface?

We just want to send to the group but we're not calling setMulticastInterface(), the code above works fine with just Ethernet. Is there any advantage to this? Or do you mean we should use setMulticastInterface() to setup two QUdpSockets and tie one each to Ethernet and Wifi?

>If you're sending to hosts in your local network only, you should use IPv6 because then you can simply set the destination interface in the scopeid of the address.

Unfortunately we don't support IPv6 yet.


More information about the Interest mailing list