mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 03:44:02 +02:00
Merge pull request #8944 from birarda/master
debug last sequence number and socket when readyRead is stuck
This commit is contained in:
commit
e2dd2d13bd
2 changed files with 18 additions and 0 deletions
|
@ -306,6 +306,13 @@ 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 << "-"
|
||||
<< _lastPacketSizeRead << "bytes";
|
||||
|
||||
|
||||
// drop all of the pending datagrams on the floor
|
||||
while (_udpSocket.hasPendingDatagrams()) {
|
||||
_udpSocket.readDatagram(nullptr, 0);
|
||||
|
@ -334,6 +341,10 @@ void Socket::readPendingDatagrams() {
|
|||
auto sizeRead = _udpSocket.readDatagram(buffer.get(), packetSizeWithHeader,
|
||||
senderSockAddr.getAddressPointer(), senderSockAddr.getPortPointer());
|
||||
|
||||
// save information for this packet, in case it is the one that sticks readyRead
|
||||
_lastPacketSizeRead = sizeRead;
|
||||
_lastPacketSockAddr = senderSockAddr;
|
||||
|
||||
if (sizeRead <= 0) {
|
||||
// we either didn't pull anything for this packet or there was an error reading (this seems to trigger
|
||||
// on windows even if there's not a packet available)
|
||||
|
@ -373,6 +384,9 @@ void Socket::readPendingDatagrams() {
|
|||
auto packet = Packet::fromReceivedPacket(std::move(buffer), packetSizeWithHeader, senderSockAddr);
|
||||
packet->setReceiveTime(receiveTime);
|
||||
|
||||
// save the sequence number in case this is the packet that sticks readyRead
|
||||
_lastReceivedSequenceNumber = packet->getSequenceNumber();
|
||||
|
||||
// call our verification operator to see if this packet is verified
|
||||
if (!_packetFilterOperator || _packetFilterOperator(*packet)) {
|
||||
if (packet->isReliable()) {
|
||||
|
|
|
@ -144,6 +144,10 @@ private:
|
|||
std::unique_ptr<CongestionControlVirtualFactory> _ccFactory { new CongestionControlFactory<TCPVegasCC>() };
|
||||
|
||||
bool _shouldChangeSocketOptions { true };
|
||||
|
||||
int _lastPacketSizeRead { 0 };
|
||||
SequenceNumber _lastReceivedSequenceNumber;
|
||||
HifiSockAddr _lastPacketSockAddr;
|
||||
|
||||
friend UDTTest;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue