#ifndef GERMANAIRLINESVA_GACONNECTOR_WEBSOCKET_H #define GERMANAIRLINESVA_GACONNECTOR_WEBSOCKET_H #define BUFSIZE 1024 #define MD5LEN 16 #include #include #include #include "types.h" #ifdef IBM // clang-format off #include #include // clang-format on #endif #ifdef APL #include #include #endif #ifdef LIN #include #include #endif #include #include #include #include #include #include class websocket { private: char lastPath[513] = ""; char lastHash[2 * MD5LEN + 1] = ""; ix::WebSocket *webSocket = nullptr; ix::WebSocketServer *server; std::mutex wsLock; std::function toLog; public: explicit websocket(std::function toLog); ~websocket(); void onClientMessageCallback( std::shared_ptr &connectionState, ix::WebSocket &ws, const ix::WebSocketMessagePtr &msg); void sendData(data d); int generateMD5(const char *filepath); }; #if defined APL || defined LIN unsigned long get_size_by_fd(int fd); #endif void to_hex(const char *hash, char *buffer); #endif