ReflectorLogic UDP heartbeat interval adjustment

It is now possible to adjust the ReflectorLogic UDP heartbeat interval
using the UDP_HEARTBEAT_INTERVAL configuration variable.
This commit is contained in:
Tobias Blomberg 2020-11-21 13:01:13 +01:00
parent 78b59d1008
commit 4c85168a70
6 changed files with 25 additions and 10 deletions

View File

@ -643,11 +643,6 @@ free-form JSON but the general structure should be kept so that SvxLink and
the reflector server can fill in dynamic information about the node like signal
strengths for receivers. Use the default node_info.json as a template. You
can add more information rather freely but don't change the overall structure.
.P
It is also possible to set audio codec parameters using the same configuration
variables as documented for networked receivers and transmitters. For example,
to lighten the encoder CPU load for the Opus encoder, set OPUS_ENC_COMPLEXITY
to something lower than 9.
.TP
.B MUTE_FIRST_TX_LOC
Mute the first transmission after selecting a talk group due to local activity.
@ -676,6 +671,17 @@ transmission to "open up" the local node. This is easy to forget.
This configuration variable determines after how many seconds a manually added
temporary talk group monitor will time out. Set to 0 to disable this feature.
Default is 3600, one hour.
.TP
.B UDP_HEARTBEAT_INTERVAL
The number of seconds between UDP heartbeat messages sent to the reflector
server. This configuration variable can normally be left at the default value
but if you get frequent disconnects due to UDP heartbeat timeout it may help to
lower this value. Default: 15
.P
It is also possible to set audio codec parameters using the same configuration
variables as documented for networked receivers and transmitters. For example,
to lighten the encoder CPU load for the Opus encoder, set OPUS_ENC_COMPLEXITY
to something lower than 9.
.
.SS QSO Recorder Section
.

View File

@ -65,6 +65,9 @@
* Added debug mode for the CTCSS detector. Enable by setting CTCSS_DEBUG to 1
in a receiver configuration section.
* ReflectorLogic: Now possible to adjust the UDP heartbeat interval using the
UDP_HEARTBEAT_INTERVAL configuration variable.
1.7.0 -- 01 Sep 2019

View File

@ -126,6 +126,7 @@ ReflectorLogic::ReflectorLogic(Async::Config& cfg, const std::string& name)
m_next_udp_tx_seq(0), m_next_udp_rx_seq(0),
m_heartbeat_timer(1000, Timer::TYPE_PERIODIC, false), m_dec(0),
m_flush_timeout_timer(3000, Timer::TYPE_ONESHOT, false),
m_udp_heartbeat_tx_cnt_reset(DEFAULT_UDP_HEARTBEAT_TX_CNT_RESET),
m_udp_heartbeat_tx_cnt(0), m_udp_heartbeat_rx_cnt(0),
m_tcp_heartbeat_tx_cnt(0), m_tcp_heartbeat_rx_cnt(0),
m_con_state(STATE_DISCONNECTED), m_enc(0), m_default_tg(0),
@ -362,6 +363,9 @@ bool ReflectorLogic::initialize(void)
m_node_info["sw"] = "SvxLink";
m_node_info["swVer"] = SVXLINK_VERSION;
cfg().getValue(name(), "UDP_HEARTBEAT_INTERVAL",
m_udp_heartbeat_tx_cnt_reset);
if (!LogicBase::initialize())
{
return false;
@ -648,7 +652,7 @@ void ReflectorLogic::onConnected(void)
cout << name() << ": Connection established to " << m_con->remoteHost() << ":"
<< m_con->remotePort() << endl;
sendMsg(MsgProtoVer());
m_udp_heartbeat_tx_cnt = UDP_HEARTBEAT_TX_CNT_RESET;
m_udp_heartbeat_tx_cnt = m_udp_heartbeat_tx_cnt_reset;
m_udp_heartbeat_rx_cnt = UDP_HEARTBEAT_RX_CNT_RESET;
m_tcp_heartbeat_tx_cnt = TCP_HEARTBEAT_TX_CNT_RESET;
m_tcp_heartbeat_rx_cnt = TCP_HEARTBEAT_RX_CNT_RESET;
@ -1283,7 +1287,7 @@ void ReflectorLogic::sendUdpMsg(const ReflectorUdpMsg& msg)
return;
}
m_udp_heartbeat_tx_cnt = UDP_HEARTBEAT_TX_CNT_RESET;
m_udp_heartbeat_tx_cnt = m_udp_heartbeat_tx_cnt_reset;
if (m_udp_sock == 0)
{

View File

@ -204,7 +204,7 @@ class ReflectorLogic : public LogicBase
typedef Async::TcpClient<Async::FramedTcpConnection> FramedTcpClient;
typedef std::set<MonitorTgEntry> MonitorTgsSet;
static const unsigned UDP_HEARTBEAT_TX_CNT_RESET = 15;
static const unsigned DEFAULT_UDP_HEARTBEAT_TX_CNT_RESET = 15;
static const unsigned UDP_HEARTBEAT_RX_CNT_RESET = 60;
static const unsigned TCP_HEARTBEAT_TX_CNT_RESET = 10;
static const unsigned TCP_HEARTBEAT_RX_CNT_RESET = 15;
@ -227,6 +227,7 @@ class ReflectorLogic : public LogicBase
Async::Timer m_heartbeat_timer;
Async::AudioDecoder* m_dec;
Async::Timer m_flush_timeout_timer;
unsigned m_udp_heartbeat_tx_cnt_reset;
unsigned m_udp_heartbeat_tx_cnt;
unsigned m_udp_heartbeat_rx_cnt;
unsigned m_tcp_heartbeat_tx_cnt;

View File

@ -98,6 +98,7 @@ EVENT_HANDLER=@SVX_SHARE_INSTALL_DIR@/events.tcl
#MUTE_FIRST_TX_LOC=1
#MUTE_FIRST_TX_REM=1
#TMP_MONITOR_TIMEOUT=3600
#UDP_HEARTBEAT_INTERVAL=15
[LinkToR4]
CONNECT_LOGICS=RepeaterLogic:94:SK3AB,SimplexLogic:92:SK3CD

View File

@ -1,4 +1,4 @@
# Project release version
# Project release version
PROJECT=master
# Version for the Qtel application
@ -11,7 +11,7 @@ LIBECHOLIB=1.3.3
LIBASYNC=1.6.0.99.10
# SvxLink versions
SVXLINK=1.7.99.24
SVXLINK=1.7.99.25
MODULE_HELP=1.0.0
MODULE_PARROT=1.1.1
MODULE_ECHO_LINK=1.5.99.0