Qt 5.10 seems to indicate pendingDatagramSizes of 0. Reading from these would block and causes an QAbstractSocket::TemporaryError to be thrown

This commit is contained in:
Seth Alves 2018-02-17 15:24:50 -08:00
parent 97abdb63db
commit 3027d3461e

View file

@ -328,14 +328,14 @@ void Socket::checkForReadyReadBackup() {
void Socket::readPendingDatagrams() {
int packetSizeWithHeader = -1;
while ((packetSizeWithHeader = _udpSocket.pendingDatagramSize()) != -1) {
while ((packetSizeWithHeader = _udpSocket.pendingDatagramSize()) > 0) {
// we're reading a packet so re-start the readyRead backup timer
_readyReadBackupTimer->start();
// grab a time point we can mark as the receive time of this packet
auto receiveTime = p_high_resolution_clock::now();
// setup a HifiSockAddr to read into
HifiSockAddr senderSockAddr;