Fix Wires-X passthrough and some code cleanups.

This commit is contained in:
Jonathan Naylor 2020-11-08 15:20:24 +00:00
parent f488dc88e1
commit a74a95360b
15 changed files with 184 additions and 50 deletions

View file

@ -119,7 +119,13 @@ bool CYSFNetwork::setDestination(const std::string& name, const sockaddr_storage
m_addrLen = addrLen;
m_linked = false;
return open();
bool ret = open();
if (ret) {
m_pollTimer.start();
return true;
} else {
return false;
}
}
void CYSFNetwork::clearDestination()
@ -152,6 +158,9 @@ void CYSFNetwork::writePoll(unsigned int count)
m_pollTimer.start();
if (m_debug)
CUtils::dump(1U, "YSF Network Data Sent", m_poll, 14U);
for (unsigned int i = 0U; i < count; i++)
m_socket.write(m_poll, 14U, m_addr, m_addrLen);
@ -181,6 +190,9 @@ void CYSFNetwork::writeUnlink(unsigned int count)
if (m_addrLen == 0U)
return;
if (m_debug)
CUtils::dump(1U, "YSF Network Data Sent", m_unlink, 14U);
for (unsigned int i = 0U; i < count; i++)
m_socket.write(m_unlink, 14U, m_addr, m_addrLen);