Older/Server/WebRTC/SignalServer.cpp
2024-01-24 23:19:53 +08:00

19 lines
461 B
C++

#include "SignalServer.h"
void SignalServer::join(const std::string &id, WebSocketSignalSession *client) {
m_clients.insert({id, client});
}
void SignalServer::leave(const std::string &id) {
if (m_clients.contains(id)) {
m_clients.erase(id);
}
}
WebSocketSignalSession *SignalServer::client(const std::string &id) {
WebSocketSignalSession *ret;
if (m_clients.contains(id)) {
ret = m_clients.at(id);
}
return ret;
}