mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-25 01:41:43 +00:00
Implement keep-alives.
This commit is contained in:
@@ -213,7 +213,9 @@ void DispatcherBase::DispatchThreadMain() {
|
||||
bool reconnect = false;
|
||||
for (auto& conn : m_connections) {
|
||||
// post outgoing messages if connection is active
|
||||
if (conn->state() == NetworkConnection::kActive) conn->PostOutgoing();
|
||||
// only send keep-alives on client
|
||||
if (conn->state() == NetworkConnection::kActive)
|
||||
conn->PostOutgoing(!m_server);
|
||||
|
||||
// if client, reconnect if connection died
|
||||
if (!m_server && conn->state() == NetworkConnection::kDead)
|
||||
|
||||
Reference in New Issue
Block a user