34using websocketpp::lib::placeholders::_1;
35using websocketpp::lib::placeholders::_2;
36using websocketpp::lib::bind;
51 con->sessionid = m_next_sessionid++;
57 std::cout <<
"Closing connection " << con->name
58 <<
" with sessionid " << con->sessionid << std::endl;
64 if (con->name.empty()) {
65 con->name = msg->get_payload();
66 std::cout <<
"Setting name of connection with sessionid "
67 << con->sessionid <<
" to " << con->name << std::endl;
69 std::cout <<
"Got a message from connection " << con->name
70 <<
" with sessionid " << con->sessionid << std::endl;
75 m_server.listen(port);
void on_message(connection_hdl hdl, server::message_ptr msg)
void on_close(connection_hdl hdl)
void on_open(connection_hdl hdl)
Concurrency policy that uses std::mutex / boost::mutex.
Stub for user supplied base class.
connection_ptr get_con_from_hdl(connection_hdl hdl, lib::error_code &ec)
Retrieves a connection_ptr from a connection_hdl (exception free)
void set_message_handler(message_handler h)
void set_open_handler(open_handler h)
connection_type::message_ptr message_ptr
void set_close_handler(close_handler h)
Stores, parses, and manipulates HTTP requests.
Stores, parses, and manipulates HTTP responses.
Basic logger that outputs to an ostream.
Represents a buffer for a single WebSocket message.
Thread safe stub "random" integer generator.
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)
connection_type::ptr connection_ptr
Asio based endpoint transport component.
websocketpp::server< custom_config > server
server::connection_ptr connection_ptr
lib::weak_ptr< void > connection_hdl
A handle to uniquely identify a connection.
core::concurrency_type concurrency_type
core::alog_type alog_type
core::endpoint_msg_manager_type endpoint_msg_manager_type
websocketpp::config::asio core
core::elog_type elog_type
core::con_msg_manager_type con_msg_manager_type
core::transport_type transport_type
connection_data connection_base
core::request_type request_type
core::message_type message_type
core::response_type response_type
core::endpoint_base endpoint_base
Server config with asio transport and TLS disabled.