Dev version: Support multiple ice connections

This commit is contained in:
dijunkun
2023-08-18 17:35:53 +08:00
parent 3a55dd0938
commit 515f0c06bd
8 changed files with 242 additions and 68 deletions

View File

@@ -20,21 +20,31 @@ class TransmissionManager {
bool ReleaseGuestFromTransmission(websocketpp::connection_hdl hdl,
const std::string& transmission_id);
bool BindHostUsernameToWsHandle(const std::string& host_username,
websocketpp::connection_hdl hdl);
bool BindGuestUsernameToWsHandle(const std::string& guest_username,
websocketpp::connection_hdl hdl);
std::string GetHostUsername(websocketpp::connection_hdl hdl);
std::string GetGuestUsername(websocketpp::connection_hdl hdl);
websocketpp::connection_hdl GetHostOfTransmission(
const std::string& transmission_id);
std::set<websocketpp::connection_hdl> GetGuestOfTransmission(
std::vector<websocketpp::connection_hdl> GetAllGuestsOfTransmission(
const std::string& transmission_id);
websocketpp::connection_hdl GetGuestWsHandle(
const std::string& guest_username);
std::vector<std::string> GetAllMembersOfTransmission(
const std::string& transmission_id);
private:
std::map<std::string, websocketpp::connection_hdl> transmission_host_list_;
std::map<std::string, std::set<websocketpp::connection_hdl>>
std::map<std::string, std::vector<websocketpp::connection_hdl>>
transmission_guest_list_;
std::map<std::string, websocketpp::connection_hdl>
transmission_host_username_list_;
std::map<std::string, websocketpp::connection_hdl>
transmission_guest_username_list_;
};