Here's a concept:
while (socket->hasPendingDatagrams()) {
// do some resize magic
socket->readDatagram(dgram.data()...);
}
// dgram == last datagram, or null.
if (!dgram.isNull())
parseDatagram(dgram);
QByteArray dgram;
while (socket->hasPendingDatagrams()) {
// do some resize magic
socket->readDatagram(dgram.data()...);
}
// dgram == last datagram, or null.
if (!dgram.isNull())
parseDatagram(dgram);
To copy to clipboard, switch view to plain text mode
There's a lot you can think of to fill in the details by just reading the documentation.
Bookmarks