#ifndef _SIGNAL_SERVER_H_ #define _SIGNAL_SERVER_H_ #include #include #include #include #include #include #include #include "transmission_manager.h" using nlohmann::json; typedef websocketpp::server server; typedef unsigned int connection_id; typedef std::string room_id; class SignalServer { public: SignalServer(); ~SignalServer(); bool on_open(websocketpp::connection_hdl hdl); bool on_close(websocketpp::connection_hdl hdl); bool on_ping(websocketpp::connection_hdl hdl, std::string s); bool on_pong(websocketpp::connection_hdl hdl, std::string s); void run(uint16_t port); void on_message(websocketpp::connection_hdl hdl, server::message_ptr msg); void send_msg(websocketpp::connection_hdl hdl, json message); private: server server_; std::map> ws_connections_; std::map rooms_; unsigned int ws_connection_id_ = 0; std::set transmission_list_; TransmissionManager transmission_manager_; }; #endif