Begin path recording trials

This commit is contained in:
2022-01-03 18:18:00 +01:00
parent 107ae2d6c9
commit 3ec41a1a19
10 changed files with 235 additions and 11 deletions
+3 -3
View File
@@ -19,7 +19,7 @@
#include <string>
#include <utility>
class websocket
class Websocket
{
private:
char lastPath[513] = "";
@@ -30,8 +30,8 @@ private:
std::function<void(std::string)> toLog;
public:
explicit websocket(std::function<void(const std::string)> toLog);
~websocket();
explicit Websocket(std::function<void(const std::string)> toLog);
~Websocket();
void onClientMessageCallback(
std::shared_ptr<ix::ConnectionState> &connectionState,
ix::WebSocket &ws,
+4 -4
View File
@@ -1,6 +1,6 @@
#include "include/websocket.h"
websocket::websocket(std::function<void(const std::string)> toLog)
Websocket::Websocket(std::function<void(const std::string)> toLog)
: toLog(std::move(toLog))
{
#ifdef IBM
@@ -27,7 +27,7 @@ websocket::websocket(std::function<void(const std::string)> toLog)
server->start();
}
websocket::~websocket()
Websocket::~Websocket()
{
server->stop();
@@ -37,7 +37,7 @@ websocket::~websocket()
#endif
}
void websocket::onClientMessageCallback(
void Websocket::onClientMessageCallback(
std::shared_ptr<ix::ConnectionState> &connectionState,
ix::WebSocket &ws,
const ix::WebSocketMessagePtr &msg)
@@ -95,7 +95,7 @@ void websocket::onClientMessageCallback(
}
}
void websocket::sendData(data d)
void Websocket::sendData(data d)
{
if (strcmp(d.path, lastPath) != 0) {
strcpy(lastPath, d.path);