Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.0.0
-
None
-
Qt 5.0.0 X-compiled on Gentoo Linux for mingw64, Windows Vista 64Bit as test environment.
-
e3bd06426afce9773fa64afe1a9946647cdec181
Description
The broadcast receiver example is not able to bind the socket.
This is the original code:
udpSocket = new QUdpSocket(this);
udpSocket->bind(45454, QUdpSocket::ShareAddress);
To show the problem, I changed the source like this:
udpSocket = new QUdpSocket(this);
if(!udpSocket->bind(45454, QUdpSocket::ShareAddress))
qDebug() << "cannot bind !!!";
This variant is working:
udpSocket = new QUdpSocket(this);
if(!udpSocket->bind(QHostAddress::AnyIPv4, 45454, QUdpSocket::ShareAddress))
qDebug() << "cannot bind !!!";
It seems that the problem is related to the changed behavior of the QHostAddress::Any enum.
Attachments
Issue Links
- relates to
-
QTBUG-28787 QTcpServer fails to start listening with Windows 7 + 8 & mingw
- Closed
For Gerrit Dashboard: QTBUG-28971 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
44213,1 | Fix socket binding on mingw builds | stable | qt/qtbase | Status: MERGED | +2 | 0 |
44561,1 | Fix socket binding on mingw builds | release | qt/qtbase | Status: MERGED | +2 | 0 |