Update to new communication protocol
This commit is contained in:
@@ -24,11 +24,10 @@ void MessageHandler::HandleMessage(const std::string& message)
|
|||||||
|
|
||||||
nlohmann::json data = nlohmann::json::parse(message);
|
nlohmann::json data = nlohmann::json::parse(message);
|
||||||
|
|
||||||
if (data.contains("code"))
|
if (data.contains("timeToLiveSeconds"))
|
||||||
{
|
{
|
||||||
if (data["code"] == 510)
|
if (data["timeToLiveSeconds"] < 60)
|
||||||
m_signal.emit();
|
m_signal.emit();
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
auto updateDataSet = data["updateDataSet"];
|
auto updateDataSet = data["updateDataSet"];
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
#include <json.hpp>
|
#include <json.hpp>
|
||||||
#include <Logging.h>
|
#include <Logging.h>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
|
||||||
namespace ToonBridge {
|
namespace ToonBridge {
|
||||||
@@ -21,6 +22,7 @@ WebSocketSubscription::~WebSocketSubscription()
|
|||||||
void WebSocketSubscription::Reconnect()
|
void WebSocketSubscription::Reconnect()
|
||||||
{
|
{
|
||||||
CloseWebSocket();
|
CloseWebSocket();
|
||||||
|
sleep(3);
|
||||||
OpenWebSocket();
|
OpenWebSocket();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user