mirror of
https://github.com/kunkundi/crossdesk.git
synced 2025-10-27 04:35:34 +08:00
Use hash in switch method instead of map list
This commit is contained in:
24
tests/signal_server/ws_handle_manager.h
Normal file
24
tests/signal_server/ws_handle_manager.h
Normal file
@@ -0,0 +1,24 @@
|
||||
#ifndef _WS_HANDLE_MANAGER_H_
|
||||
#define _WS_HANDLE_MANAGER_H_
|
||||
|
||||
#include <iostream>
|
||||
#include <websocketpp/server.hpp>
|
||||
|
||||
class WsHandleManager {
|
||||
public:
|
||||
WsHandleManager();
|
||||
~WsHandleManager();
|
||||
|
||||
public:
|
||||
bool BindHandleToConnection(websocketpp::connection_hdl hdl,
|
||||
std::string& connection_id);
|
||||
bool ReleaseHandleFromConnection(websocketpp::connection_hdl hdl,
|
||||
std::string& connection_id);
|
||||
|
||||
const std::string& GetConnectionId(websocketpp::connection_hdl hdl);
|
||||
websocketpp::connection_hdl GetWsHandle(std::string& connection_id);
|
||||
|
||||
private:
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user