Merge pull request #12437 from sethalves/fix-qt-5-10-udt

fix Qt 5.10 udt packet reading
This commit is contained in:
Ryan Huffman 2018-02-26 13:50:41 -08:00 committed by GitHub
commit 24da043937
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -328,14 +328,14 @@ void Socket::checkForReadyReadBackup() {
void Socket::readPendingDatagrams() {
int packetSizeWithHeader = -1;
while ((packetSizeWithHeader = _udpSocket.pendingDatagramSize()) != -1) {
while (_udpSocket.hasPendingDatagrams() && (packetSizeWithHeader = _udpSocket.pendingDatagramSize()) != -1) {
// 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;