1
0
Fork 0

Tweak the data transfer management.

ycs232-kbc
Jonathan Naylor 9 years ago committed by GitHub
parent df04d34595
commit 59b4908d5f

@ -161,7 +161,7 @@ int CYSFGateway::run()
std::string callsign = m_conf.getCallsign(); std::string callsign = m_conf.getCallsign();
bool debug = m_conf.getNetworkDebug(); bool debug = m_conf.getNetworkDebug();
in_addr rptAddress = CUDPSocket::lookup(m_conf.getRptAddress()); in_addr rptAddress = CUDPSocket::lookup(m_conf.getRptAddress());
unsigned int rptPort = m_conf.getRptPort(); unsigned int rptPort = m_conf.getRptPort();
std::string myAddress = m_conf.getMyAddress(); std::string myAddress = m_conf.getMyAddress();
@ -188,11 +188,11 @@ int CYSFGateway::run()
bool networkEnabled = m_conf.getNetworkEnabled(); bool networkEnabled = m_conf.getNetworkEnabled();
if (networkEnabled) { if (networkEnabled) {
std::string fileName = m_conf.getNetworkHosts(); std::string fileName = m_conf.getNetworkHosts();
unsigned int port = m_conf.getNetworkStatusPort(); unsigned int port = m_conf.getNetworkStatusPort();
m_wiresX = new CWiresX(callsign, &rptNetwork, fileName, port); m_wiresX = new CWiresX(callsign, &rptNetwork, fileName, port);
std::string name = m_conf.getName(); std::string name = m_conf.getName();
unsigned int txFrequency = m_conf.getTxFrequency(); unsigned int txFrequency = m_conf.getTxFrequency();
unsigned int rxFrequency = m_conf.getRxFrequency(); unsigned int rxFrequency = m_conf.getRxFrequency();
@ -213,8 +213,7 @@ int CYSFGateway::run()
for (;;) { for (;;) {
unsigned char buffer[200U]; unsigned char buffer[200U];
unsigned int len = rptNetwork.read(buffer); while (rptNetwork.read(buffer) > 0U) {
if (len > 0U) {
watchdogTimer.start(); watchdogTimer.start();
CYSFFICH fich; CYSFFICH fich;
@ -262,8 +261,7 @@ int CYSFGateway::run()
} }
} }
len = m_netNetwork->read(buffer); while (m_netNetwork->read(buffer) > 0U) {
if (len > 0U) {
if (networkEnabled && m_linked) if (networkEnabled && m_linked)
rptNetwork.write(buffer); rptNetwork.write(buffer);
} }

Loading…
Cancel
Save