c++ - Qt: joinMulticastGroup for all interface -


in windows have 2 physical interface. on each interface set 2 ip address: ipv4 , ipv6. following code doesn't correct working in configuration: joinmulticastgroup return true first interface , next interface joinmulticastgroup return false.

but, if turn off ipv6 on windows interfaces code working.

help me understand.

qudpsocket udpsocket; qhostaddress groupaddress;  groupaddress = qhostaddress("239.255.255.250"); udpsocket.bind(qhostaddress::anyipv4, 1900,                 qudpsocket::shareaddress | qudpsocket::reuseaddresshint);  qlist<qnetworkinterface> mlistifaces = qnetworkinterface::allinterfaces();  (int = 0; < mlistifaces.length(); ++i) {     bool rez = udpsocket.joinmulticastgroup(groupaddress, mlistifaces.at(i));     qdebug() << rez; } 

i dealing multicast , qt, , problem seems still exist qt 5.6 , win7.

the problem joinmulticastgroup() uses first address of interface without checking if it's ipv4 or ipv6 (even if use anyipv4 in bind).

this issue not fixed in official qt release, proposed patch works me:

https://bugreports.qt.io/browse/qtbug-27641


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -