From 6f42e0dad3d2e52f811d7c5487c7fb822c754784 Mon Sep 17 00:00:00 2001 From: Jonathan Naylor Date: Mon, 25 Apr 2016 17:10:56 +0100 Subject: [PATCH] Be more agressive at trying to reconnect after a failure. --- DMRIPSC.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/DMRIPSC.cpp b/DMRIPSC.cpp index e02f26b..2b0753a 100644 --- a/DMRIPSC.cpp +++ b/DMRIPSC.cpp @@ -353,6 +353,7 @@ void CDMRIPSC::clock(unsigned int ms) m_status = DISCONNECTED; // XXX m_timeoutTimer.stop(); m_retryTimer.stop(); + m_pingTimer.stop(); } else if (::memcmp(m_buffer, "MSTPONG", 7U) == 0) { m_timeoutTimer.start(); } else if (::memcmp(m_buffer, "RPTSBKN", 7U) == 0) { @@ -391,10 +392,11 @@ void CDMRIPSC::clock(unsigned int ms) m_timeoutTimer.clock(ms); if (m_timeoutTimer.isRunning() && m_timeoutTimer.hasExpired()) { - LogError("Connection to the master has timed out"); - m_status = DISCONNECTED; - m_timeoutTimer.stop(); - m_retryTimer.stop(); + LogError("Connection to the master has timed out, retrying connection"); + m_status = WAITING_LOGIN; + m_timeoutTimer.start(); + m_retryTimer.start(); + m_pingTimer.stop(); } }