34 using websocketpp::lib::placeholders::_1;
35 using websocketpp::lib::placeholders::_2;
36 using 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;
74 void run(uint16_t port) {
75 m_server.listen(port);
76 m_server.start_accept();
Asio based endpoint transport component.
Concurrency policy that uses std::mutex / boost::mutex.
connection_type::message_ptr message_ptr
Type of message pointers that this endpoint uses.
void on_message(connection_hdl hdl, server::message_ptr msg)
core::endpoint_msg_manager_type endpoint_msg_manager_type
lib::weak_ptr< void > connection_hdl
A handle to uniquely identify a connection.
core::alog_type alog_type
core::concurrency_type concurrency_type
Stores, parses, and manipulates HTTP responses.
core::transport_type transport_type
core::response_type response_type
server::connection_ptr connection_ptr
Basic logger that outputs to an ostream.
Stub for user supplied base class.
websocketpp::server< custom_config > server
Server endpoint role based on the given config.
Thread safe stub "random" integer generator.
Represents a buffer for a single WebSocket message.
void on_open(connection_hdl hdl)
void on_close(connection_hdl hdl)
websocketpp::config::asio core
core::endpoint_base endpoint_base
core::request_type request_type
connection_data connection_base
Stores, parses, and manipulates HTTP requests.
connection_type::ptr connection_ptr
Type of a shared pointer to the connections this server will create.
client::connection_ptr connection_ptr
core::con_msg_manager_type con_msg_manager_type
core::message_type message_type
A connection message manager that allocates a new message for each request.
An endpoint message manager that allocates a new manager for each connection.
Server config with asio transport and TLS disabled.
core::elog_type elog_type