mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 07:19:14 +02:00
additional debug logging for microdisconnects
This commit is contained in:
parent
970fa8b5f0
commit
de6e1d0217
2 changed files with 10 additions and 15 deletions
|
@ -89,7 +89,7 @@ SequenceNumberStats::ArrivalInfo SequenceNumberStats::sequenceNumberReceived(qui
|
||||||
} else if (absGap > MAX_REASONABLE_SEQUENCE_GAP) {
|
} else if (absGap > MAX_REASONABLE_SEQUENCE_GAP) {
|
||||||
arrivalInfo._status = Unreasonable;
|
arrivalInfo._status = Unreasonable;
|
||||||
|
|
||||||
HIFI_FCDEBUG(networking(), "unreasonable sequence number:" << incoming << "previous:" << _lastReceivedSequence);
|
qCDebug(networking) << "unreasonable sequence number:" << incoming << "previous:" << _lastReceivedSequence;
|
||||||
|
|
||||||
_stats._unreasonable++;
|
_stats._unreasonable++;
|
||||||
|
|
||||||
|
@ -153,7 +153,7 @@ SequenceNumberStats::ArrivalInfo SequenceNumberStats::sequenceNumberReceived(qui
|
||||||
|
|
||||||
arrivalInfo._status = Unreasonable;
|
arrivalInfo._status = Unreasonable;
|
||||||
|
|
||||||
HIFI_FCDEBUG(networking(), "unreasonable sequence number:" << incoming << "(possible duplicate)");
|
qCDebug(networking) << "unreasonable sequence number:" << incoming << "(possible duplicate)";
|
||||||
|
|
||||||
_stats._unreasonable++;
|
_stats._unreasonable++;
|
||||||
|
|
||||||
|
|
|
@ -162,16 +162,16 @@ qint64 Socket::writePacket(std::unique_ptr<Packet> packet, const HifiSockAddr& s
|
||||||
}
|
}
|
||||||
|
|
||||||
qint64 Socket::writePacketList(std::unique_ptr<PacketList> packetList, const HifiSockAddr& sockAddr) {
|
qint64 Socket::writePacketList(std::unique_ptr<PacketList> packetList, const HifiSockAddr& sockAddr) {
|
||||||
|
|
||||||
|
if (packetList->getNumPackets() == 0) {
|
||||||
|
qCWarning(networking) << "Trying to send packet list with 0 packets, bailing.";
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (packetList->isReliable()) {
|
if (packetList->isReliable()) {
|
||||||
// hand this packetList off to writeReliablePacketList
|
// hand this packetList off to writeReliablePacketList
|
||||||
// because Qt can't invoke with the unique_ptr we have to release it here and re-construct in writeReliablePacketList
|
// because Qt can't invoke with the unique_ptr we have to release it here and re-construct in writeReliablePacketList
|
||||||
|
|
||||||
if (packetList->getNumPackets() == 0) {
|
|
||||||
qCWarning(networking) << "Trying to send packet list with 0 packets, bailing.";
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (QThread::currentThread() != thread()) {
|
if (QThread::currentThread() != thread()) {
|
||||||
auto ptr = packetList.release();
|
auto ptr = packetList.release();
|
||||||
QMetaObject::invokeMethod(this, "writeReliablePacketList", Qt::AutoConnection,
|
QMetaObject::invokeMethod(this, "writeReliablePacketList", Qt::AutoConnection,
|
||||||
|
@ -189,7 +189,6 @@ qint64 Socket::writePacketList(std::unique_ptr<PacketList> packetList, const Hif
|
||||||
while (!packetList->_packets.empty()) {
|
while (!packetList->_packets.empty()) {
|
||||||
totalBytesSent += writePacket(packetList->takeFront<Packet>(), sockAddr);
|
totalBytesSent += writePacket(packetList->takeFront<Packet>(), sockAddr);
|
||||||
}
|
}
|
||||||
|
|
||||||
return totalBytesSent;
|
return totalBytesSent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -228,7 +227,7 @@ qint64 Socket::writeDatagram(const QByteArray& datagram, const HifiSockAddr& soc
|
||||||
|
|
||||||
if (bytesWritten < 0) {
|
if (bytesWritten < 0) {
|
||||||
// when saturating a link this isn't an uncommon message - suppress it so it doesn't bomb the debug
|
// when saturating a link this isn't an uncommon message - suppress it so it doesn't bomb the debug
|
||||||
HIFI_FCDEBUG(networking(), "Socket::writeDatagram" << _udpSocket.error());
|
qCDebug(networking) << "Socket::writeDatagram : " << sockAddr << " " << _udpSocket.error();
|
||||||
}
|
}
|
||||||
|
|
||||||
return bytesWritten;
|
return bytesWritten;
|
||||||
|
@ -242,10 +241,8 @@ Connection* Socket::findOrCreateConnection(const HifiSockAddr& sockAddr, bool fi
|
||||||
|
|
||||||
if (filterCreate && _connectionCreationFilterOperator && !_connectionCreationFilterOperator(sockAddr)) {
|
if (filterCreate && _connectionCreationFilterOperator && !_connectionCreationFilterOperator(sockAddr)) {
|
||||||
// the connection creation filter did not allow us to create a new connection
|
// the connection creation filter did not allow us to create a new connection
|
||||||
#ifdef UDT_CONNECTION_DEBUG
|
|
||||||
qCDebug(networking) << "Socket::findOrCreateConnection refusing to create connection for" << sockAddr
|
qCDebug(networking) << "Socket::findOrCreateConnection refusing to create connection for" << sockAddr
|
||||||
<< "due to connection creation filter";
|
<< "due to connection creation filter";
|
||||||
#endif
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
} else {
|
} else {
|
||||||
auto congestionControl = _ccFactory->create();
|
auto congestionControl = _ccFactory->create();
|
||||||
|
@ -259,9 +256,7 @@ Connection* Socket::findOrCreateConnection(const HifiSockAddr& sockAddr, bool fi
|
||||||
QObject::connect(connection.get(), &Connection::receiverHandshakeRequestComplete,
|
QObject::connect(connection.get(), &Connection::receiverHandshakeRequestComplete,
|
||||||
this, &Socket::clientHandshakeRequestComplete);
|
this, &Socket::clientHandshakeRequestComplete);
|
||||||
|
|
||||||
#ifdef UDT_CONNECTION_DEBUG
|
|
||||||
qCDebug(networking) << "Creating new connection to" << sockAddr;
|
qCDebug(networking) << "Creating new connection to" << sockAddr;
|
||||||
#endif
|
|
||||||
|
|
||||||
it = _connectionsHash.insert(it, std::make_pair(sockAddr, std::move(connection)));
|
it = _connectionsHash.insert(it, std::make_pair(sockAddr, std::move(connection)));
|
||||||
}
|
}
|
||||||
|
@ -489,7 +484,7 @@ std::vector<HifiSockAddr> Socket::getConnectionSockAddrs() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Socket::handleSocketError(QAbstractSocket::SocketError socketError) {
|
void Socket::handleSocketError(QAbstractSocket::SocketError socketError) {
|
||||||
HIFI_FCDEBUG(networking(), "udt::Socket error - " << socketError);
|
qCDebug(networking) << "udt::Socket error - " << socketError;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Socket::handleStateChanged(QAbstractSocket::SocketState socketState) {
|
void Socket::handleStateChanged(QAbstractSocket::SocketState socketState) {
|
||||||
|
|
Loading…
Reference in a new issue