[Interest] MultiCast problem.

Guido Seifert wargand at gmx.de
Mon Sep 9 19:25:59 CEST 2013


Hi,
I currently port a Qt4 program to Qt5. I have the following trouble with a multicast socket.

On Qt4:

mReceiver = new QUdpSocket(this);
mReceiver->bind(1900, QUdpSocket::ReuseAddressHint|QUdpSocket::ShareAddress);
mReceiver->joinMulticastGroup("Address");

Works great.

Now under Qt5:
First I got a warning:
QAbstractSocket: cannot bind to QHostAddress::Any (or an IPv6 address) ... yada yada

Ok, so I changed the code:

mReceiver->bind(QHostAddress(QHostAddress::AnyIPv4),1900, 
QUdpSocket::ReuseAddressHint|QUdpSocket::ShareAddress);
mReceiver->joinMulticastGroup("Address");

Result? No warning. But I don't receive anything on this port either.

Help?

Guido
 



More information about the Interest mailing list