Remove call to has pending datagrams

This commit is contained in:
Atlante45 2015-08-03 17:14:42 -07:00
parent acd7a7a732
commit c0852f0eb2
2 changed files with 3 additions and 4 deletions

View file

@ -283,9 +283,8 @@ bool Connection::processReceivedSequenceNumber(SequenceNumber sequenceNumber, in
_receiveWindow.onProbePair1Arrival();
} else if (((uint32_t) sequenceNumber & 0xF) == 1) {
_receiveWindow.onProbePair2Arrival();
} else {
_receiveWindow.onPacketArrival();
}
_receiveWindow.onPacketArrival();
// If this is not the next sequence number, report loss
if (sequenceNumber > _lastReceivedSequenceNumber + 1) {

View file

@ -129,12 +129,12 @@ Connection& Socket::findOrCreateConnection(const HifiSockAddr& sockAddr) {
}
void Socket::readPendingDatagrams() {
while (_udpSocket.hasPendingDatagrams()) {
int packetSizeWithHeader = -1;
while ((packetSizeWithHeader = _udpSocket.pendingDatagramSize()) != -1) {
// setup a HifiSockAddr to read into
HifiSockAddr senderSockAddr;
// setup a buffer to read the packet into
int packetSizeWithHeader = _udpSocket.pendingDatagramSize();
auto buffer = std::unique_ptr<char[]>(new char[packetSizeWithHeader]);
// pull the datagram