face: detect websocket connection failure using ping/pong messages.
Change-Id: I66ef6a3921a56f1bb8e49fb6fdb4fa14b6a379c7
Refs: #1903
diff --git a/daemon/face/websocket-face.hpp b/daemon/face/websocket-face.hpp
index 3f2a932..81a1111 100644
--- a/daemon/face/websocket-face.hpp
+++ b/daemon/face/websocket-face.hpp
@@ -28,6 +28,7 @@
#include "face.hpp"
#include "core/logger.hpp"
+#include "core/scheduler.hpp"
#ifndef HAVE_WEBSOCKET
#error "Cannot include this file when WebSocket support is not enabled"
@@ -64,11 +65,18 @@
close();
void
+ setPingEventId(EventId& id)
+ {
+ m_pingEventId = id;
+ }
+
+ void
handleReceive(const std::string& msg);
private:
websocketpp::connection_hdl m_handle;
websocket::Server& m_server;
+ EventId m_pingEventId;
bool m_closed;
};