Details
-
Bug
-
Resolution: Invalid
-
Not Evaluated
-
None
-
4.8.0
-
Symbian Belle Refresh
Symbian Belle FP1
Symbian Belle FP2
Description
Use of QUdpSocket::pendingDatagramSize and readDatagram is not compatible with other platforms or previous versions of Qt on Symbian.
The new Symbian implementation of pendingDatagramSize in 4.8's qsymbiansocketengine.cpp throws away the datagram header, thereby losing the sender address and port information. This breaks code like the sample below:
void DuktoProtocol::newUdpData()
{
while (mSocket->hasPendingDatagrams()) {
QByteArray datagram;
datagram.resize(mSocket->pendingDatagramSize());
QHostAddress sender;
quint16 senderPort;
mSocket->readDatagram(datagram.data(), datagram.size(), &sender, &senderPort);
handleMessage(datagram, sender);
}
}
Full source is available at:
https://code.google.com/p/dukto/source/browse/trunk/duktoprotocol.cpp
The expected behaviour is that pendingDatagramSize does not throw away the sender address and port information. When non-null sender and port parameters are supplied to readDatagram, this method should always provide the caller with this info from the datagram.
http://qt-project.org/doc/qt-4.8/qudpsocket.html#readDatagram