2024-01-24 23:19:53 +08:00
|
|
|
#ifndef __SIGNALSERVER_H__
|
|
|
|
#define __SIGNALSERVER_H__
|
|
|
|
|
|
|
|
#include "Singleton.h"
|
|
|
|
#include <string>
|
|
|
|
#include <unordered_map>
|
|
|
|
|
|
|
|
class WebSocketSignalSession;
|
2025-01-10 21:49:22 +08:00
|
|
|
class Application;
|
2024-01-24 23:19:53 +08:00
|
|
|
|
|
|
|
class SignalServer {
|
|
|
|
public:
|
2025-01-10 21:49:22 +08:00
|
|
|
SignalServer(Application &app);
|
2024-01-24 23:19:53 +08:00
|
|
|
void join(const std::string &id, WebSocketSignalSession *client);
|
|
|
|
void leave(const std::string &id);
|
|
|
|
WebSocketSignalSession *client(const std::string &id);
|
|
|
|
|
|
|
|
private:
|
|
|
|
std::unordered_map<std::string, WebSocketSignalSession *> m_clients;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __SIGNALSERVER_H__
|