From a5e94eea755e2347a9b033a1e12994a7ce4d8a88 Mon Sep 17 00:00:00 2001 From: Simon Walton Date: Thu, 11 Apr 2019 17:36:09 -0700 Subject: [PATCH] Increase ping interval for unconnected Nodes --- libraries/networking/src/NetworkPeer.h | 2 +- libraries/networking/src/NodeList.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libraries/networking/src/NetworkPeer.h b/libraries/networking/src/NetworkPeer.h index b75d2f8b86..43fbc753eb 100644 --- a/libraries/networking/src/NetworkPeer.h +++ b/libraries/networking/src/NetworkPeer.h @@ -26,7 +26,7 @@ const quint16 ICE_SERVER_DEFAULT_PORT = 7337; const int ICE_HEARBEAT_INTERVAL_MSECS = 2 * 1000; const int MAX_ICE_CONNECTION_ATTEMPTS = 5; -const int UDP_PUNCH_PING_INTERVAL_MS = 25; +const int UDP_PUNCH_PING_INTERVAL_MS = 250; class NetworkPeer : public QObject { Q_OBJECT diff --git a/libraries/networking/src/NodeList.cpp b/libraries/networking/src/NodeList.cpp index 0021a594bc..0a4c63d712 100644 --- a/libraries/networking/src/NodeList.cpp +++ b/libraries/networking/src/NodeList.cpp @@ -752,11 +752,11 @@ void NodeList::pingPunchForInactiveNode(const SharedNodePointer& node) { flagTimeForConnectionStep(LimitedNodeList::ConnectionStep::SendAudioPing); } - // every second we're trying to ping this node and we're not getting anywhere - debug that out - const int NUM_DEBUG_CONNECTION_ATTEMPTS = 1000 / (UDP_PUNCH_PING_INTERVAL_MS); + // every two seconds we're trying to ping this node and we're not getting anywhere - debug that out + const int NUM_DEBUG_CONNECTION_ATTEMPTS = 2000 / (UDP_PUNCH_PING_INTERVAL_MS); if (node->getConnectionAttempts() > 0 && node->getConnectionAttempts() % NUM_DEBUG_CONNECTION_ATTEMPTS == 0) { - qCDebug(networking) << "No response to UDP hole punch pings for node" << node->getUUID() << "in last second."; + qCDebug(networking) << "No response to UDP hole punch pings for node" << node->getUUID() << "in last 2 s."; } auto nodeID = node->getUUID();