(cobra client) send a websocket ping every 30s to keep the connection opened

This commit is contained in:
Benjamin Sergeant
2019-12-24 17:16:41 -08:00
parent b9cc6d7e23
commit ee65f95fe3
9 changed files with 36 additions and 3 deletions
+4
View File
@@ -91,6 +91,10 @@ namespace ix
spdlog::info("Published message id {} acked", msgId);
messageAcked = true;
}
else if (eventType == ix::CobraConnection_EventType_Pong)
{
spdlog::info("Received websocket pong");
}
});
conn.connect();
+4
View File
@@ -100,6 +100,10 @@ namespace ix
{
spdlog::error("Published message hacked: {}", msgId);
}
else if (eventType == ix::CobraConnection_EventType_Pong)
{
spdlog::info("Received websocket pong");
}
});
while (true)
+4
View File
@@ -245,6 +245,10 @@ namespace ix
{
spdlog::error("Published message hacked: {}", msgId);
}
else if (eventType == ix::CobraConnection_EventType_Pong)
{
spdlog::info("Received websocket pong");
}
});
while (true)
+4
View File
@@ -160,6 +160,10 @@ namespace ix
{
spdlog::error("Published message hacked: {}", msgId);
}
else if (eventType == ix::CobraConnection_EventType_Pong)
{
spdlog::info("Received websocket pong");
}
});
while (true)