3
0
Fork 0
mirror of https://github.com/lubosz/overte.git synced 2025-04-26 17:15:37 +02:00

output last seq number and last socket before readyRead sticks

This commit is contained in:
Stephen Birarda 2016-10-27 21:50:29 -07:00
parent c41af25776
commit db7f5724f7
2 changed files with 12 additions and 0 deletions
libraries/networking/src/udt

View file

@ -306,6 +306,11 @@ void Socket::checkForReadyReadBackup() {
if (_udpSocket.hasPendingDatagrams()) {
qCDebug(networking) << "Socket::checkForReadyReadBackup() detected blocked readyRead signal. Flushing pending datagrams.";
// so that birarda can possibly figure out how the heck we get into this state in the first place
// output the sequence number and socket address of the last processed packet
qCDebug(networking) << "Socket::checkForReadyReadyBackup() last sequence number"
<< (uint32_t) _lastReceivedSequenceNumber << "from" << _lastPacketSockAddr;
// drop all of the pending datagrams on the floor
while (_udpSocket.hasPendingDatagrams()) {
_udpSocket.readDatagram(nullptr, 0);
@ -373,6 +378,10 @@ void Socket::readPendingDatagrams() {
auto packet = Packet::fromReceivedPacket(std::move(buffer), packetSizeWithHeader, senderSockAddr);
packet->setReceiveTime(receiveTime);
// save the sequence number and socket for this packet, in case this is the packet that sticks readyRead
_lastPacketSockAddr = senderSockAddr;
_lastReceivedSequenceNumber = packet->getSequenceNumber();
// call our verification operator to see if this packet is verified
if (!_packetFilterOperator || _packetFilterOperator(*packet)) {
if (packet->isReliable()) {

View file

@ -144,6 +144,9 @@ private:
std::unique_ptr<CongestionControlVirtualFactory> _ccFactory { new CongestionControlFactory<TCPVegasCC>() };
bool _shouldChangeSocketOptions { true };
SequenceNumber _lastReceivedSequenceNumber;
HifiSockAddr _lastPacketSockAddr;
friend UDTTest;
};