23 std::lock_guard<std::mutex>
lock(m_mutex);
24 m_connections.insert(hdl);
28 std::lock_guard<std::mutex>
lock(m_mutex);
29 m_connections.erase(hdl);
40 std::lock_guard<std::mutex>
lock(m_mutex);
41 for (
auto it : m_connections) {
48 m_server.listen(port);
53 typedef std::set<connection_hdl,std::owner_less<connection_hdl>> con_list;
57 con_list m_connections;
void on_open(connection_hdl hdl)
void on_close(connection_hdl hdl)
void send(connection_hdl hdl, std::string const &payload, frame::opcode::value op, lib::error_code &ec)
Create a message and add it to the outgoing send queue (exception free)
void set_open_handler(open_handler h)
void set_close_handler(close_handler h)
Server endpoint role based on the given config.
void start_accept(lib::error_code &ec)
Starts the server's async connection acceptance loop (exception free)
lib::weak_ptr< void > connection_hdl
A handle to uniquely identify a connection.
websocketpp::server< websocketpp::config::asio > server