mirror of
https://github.com/g4klx/MMDVMHost
synced 2025-12-21 15:09:23 +08:00
Make the DMR IPSC connection more resiliant.
This commit is contained in:
12
DMRIPSC.cpp
12
DMRIPSC.cpp
@@ -350,10 +350,8 @@ void CDMRIPSC::clock(unsigned int ms)
|
|||||||
}
|
}
|
||||||
} else if (::memcmp(m_buffer, "MSTCL", 5U) == 0) {
|
} else if (::memcmp(m_buffer, "MSTCL", 5U) == 0) {
|
||||||
LogError("Master is closing down");
|
LogError("Master is closing down");
|
||||||
m_status = DISCONNECTED; // XXX
|
close();
|
||||||
m_timeoutTimer.stop();
|
open();
|
||||||
m_retryTimer.stop();
|
|
||||||
m_pingTimer.stop();
|
|
||||||
} else if (::memcmp(m_buffer, "MSTPONG", 7U) == 0) {
|
} else if (::memcmp(m_buffer, "MSTPONG", 7U) == 0) {
|
||||||
m_timeoutTimer.start();
|
m_timeoutTimer.start();
|
||||||
} else if (::memcmp(m_buffer, "RPTSBKN", 7U) == 0) {
|
} else if (::memcmp(m_buffer, "RPTSBKN", 7U) == 0) {
|
||||||
@@ -393,10 +391,8 @@ void CDMRIPSC::clock(unsigned int ms)
|
|||||||
m_timeoutTimer.clock(ms);
|
m_timeoutTimer.clock(ms);
|
||||||
if (m_timeoutTimer.isRunning() && m_timeoutTimer.hasExpired()) {
|
if (m_timeoutTimer.isRunning() && m_timeoutTimer.hasExpired()) {
|
||||||
LogError("Connection to the master has timed out, retrying connection");
|
LogError("Connection to the master has timed out, retrying connection");
|
||||||
m_status = WAITING_LOGIN;
|
close();
|
||||||
m_timeoutTimer.start();
|
open();
|
||||||
m_retryTimer.start();
|
|
||||||
m_pingTimer.stop();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user