8 #include <unordered_set>
14 class QWebSocketServer;
16 class WSServer : public QObject {
20 WSServer(const std::string &host, int port);
22 void set_connection_callback(const std::function<void(bool)> &callback);
23 void send_command(const std::string &cmd);
24 void change_port(int port);
27 void on_new_connection();
33 std::function<void(bool)> connection_callback;
35 QWebSocketServer *ws_server;
36 std::unordered_set<QWebSocket *> clients;
39 #endif // !defined(_WS_SERVER_H)