diff --git a/libraries/networking/src/LimitedNodeList.h b/libraries/networking/src/LimitedNodeList.h index 719387ace1..abf292e65e 100644 --- a/libraries/networking/src/LimitedNodeList.h +++ b/libraries/networking/src/LimitedNodeList.h @@ -43,7 +43,7 @@ #include "udt/Socket.h" #include "UUIDHasher.h" -const quint64 NODE_SILENCE_THRESHOLD_MSECS = 2 * 1000; +const quint64 NODE_SILENCE_THRESHOLD_MSECS = 5 * 1000; extern const char SOLO_NODE_TYPES[2]; diff --git a/libraries/networking/src/udt/Connection.cpp b/libraries/networking/src/udt/Connection.cpp index 84928fa298..f159ff517c 100644 --- a/libraries/networking/src/udt/Connection.cpp +++ b/libraries/networking/src/udt/Connection.cpp @@ -81,9 +81,9 @@ SendQueue& Connection::getSendQueue() { // Lasily create send queue _sendQueue = SendQueue::create(_parentSocket, _destination); - #ifdef UDT_CONNECTION_DEBUG +#ifdef UDT_CONNECTION_DEBUG qCDebug(networking) << "Created SendQueue for connection to" << _destination; - #endif +#endif QObject::connect(_sendQueue.get(), &SendQueue::packetSent, this, &Connection::packetSent); QObject::connect(_sendQueue.get(), &SendQueue::packetSent, this, &Connection::recordSentPackets); @@ -103,14 +103,14 @@ void Connection::queueInactive() { // tell our current send queue to go down and reset our ptr to it to null stopSendQueue(); - #ifdef UDT_CONNECTION_DEBUG +#ifdef UDT_CONNECTION_DEBUG qCDebug(networking) << "Connection to" << _destination << "has stopped its SendQueue."; - #endif +#endif if (!_hasReceivedHandshake || !_isReceivingData) { - #ifdef UDT_CONNECTION_DEBUG +#ifdef UDT_CONNECTION_DEBUG qCDebug(networking) << "Connection SendQueue to" << _destination << "stopped and no data is being received - stopping connection."; - #endif +#endif emit connectionInactive(_destination); } @@ -167,9 +167,9 @@ void Connection::sync() { // otherwise we'll wait for it to also timeout before cleaning up if (!_sendQueue) { - #ifdef UDT_CONNECTION_DEBUG +#ifdef UDT_CONNECTION_DEBUG qCDebug(networking) << "Connection to" << _destination << "no longer receiving any data and there is currently no send queue - stopping connection."; - #endif +#endif emit connectionInactive(_destination); } @@ -203,10 +203,10 @@ void Connection::sync() { // it's been CONNECTION_NOT_USED_EXPIRY_SECONDS and nothing has actually happened with this connection // consider it inactive and emit our inactivity signal - #ifdef UDT_CONNECTION_DEBUG +#ifdef UDT_CONNECTION_DEBUG qCDebug(networking) << "Connection to" << _destination << "did not receive or send any data in last" << CONNECTION_NOT_USED_EXPIRY_SECONDS << "seconds - stopping connection."; - #endif +#endif emit connectionInactive(_destination); } diff --git a/libraries/networking/src/udt/SendQueue.cpp b/libraries/networking/src/udt/SendQueue.cpp index 28f71ec93f..04b3921aac 100644 --- a/libraries/networking/src/udt/SendQueue.cpp +++ b/libraries/networking/src/udt/SendQueue.cpp @@ -343,10 +343,10 @@ void SendQueue::run() { // If the flow window has been full for over CONSIDER_INACTIVE_AFTER, // then signal the queue is inactive and return so it can be cleaned up - #ifdef UDT_CONNECTION_DEBUG +#ifdef UDT_CONNECTION_DEBUG qCDebug(networking) << "SendQueue to" << _destination << "reached" << NUM_TIMEOUTS_BEFORE_INACTIVE << "timeouts" << "and 10s before receiving any ACK/NAK and is now inactive. Stopping."; - #endif +#endif deactivate(); @@ -374,12 +374,12 @@ void SendQueue::run() { doubleLock.unlock(); if (cvStatus == std::cv_status::timeout) { - #ifdef UDT_CONNECTION_DEBUG +#ifdef UDT_CONNECTION_DEBUG qCDebug(networking) << "SendQueue to" << _destination << "has been empty for" << EMPTY_QUEUES_INACTIVE_TIMEOUT.count() << "seconds and receiver has ACKed all packets." << "The queue is now inactive and will be stopped."; - #endif +#endif deactivate(); diff --git a/libraries/networking/src/udt/Socket.cpp b/libraries/networking/src/udt/Socket.cpp index a0aa767de1..56a00c6808 100644 --- a/libraries/networking/src/udt/Socket.cpp +++ b/libraries/networking/src/udt/Socket.cpp @@ -186,9 +186,9 @@ Connection& Socket::findOrCreateConnection(const HifiSockAddr& sockAddr) { QObject::connect(connection.get(), &Connection::connectionInactive, this, &Socket::cleanupConnection, Qt::QueuedConnection); - #ifdef UDT_CONNECTION_DEBUG +#ifdef UDT_CONNECTION_DEBUG qCDebug(networking) << "Creating new connection to" << sockAddr; - #endif +#endif it = _connectionsHash.insert(it, std::make_pair(sockAddr, std::move(connection))); } @@ -208,9 +208,9 @@ void Socket::clearConnections() { } void Socket::cleanupConnection(HifiSockAddr sockAddr) { - #ifdef UDT_CONNECTION_DEBUG +#ifdef UDT_CONNECTION_DEBUG qCDebug(networking) << "Socket::cleanupConnection called for UDT connection to" << sockAddr; - #endif +#endif _connectionsHash.erase(sockAddr); } diff --git a/libraries/networking/src/udt/Socket.h b/libraries/networking/src/udt/Socket.h index 457d3feffc..68fcb483b0 100644 --- a/libraries/networking/src/udt/Socket.h +++ b/libraries/networking/src/udt/Socket.h @@ -25,7 +25,7 @@ #include "CongestionControl.h" #include "Connection.h" -#define UDT_CONNECTION_DEBUG +//#define UDT_CONNECTION_DEBUG class UDTTest;