#ifndef _SIGNAL_SERVER_H_ #define _SIGNAL_SERVER_H_ #include #include #include #include #include #include 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(); 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> connections_; std::map rooms_; unsigned int connection_id_ = 0; std::string transport_id_ = "000000"; std::map offer_sdp_map_; std::map answer_sdp_map_; std::map offer_hdl_map_; std::map answer_hdl_map_; }; #endif