2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
33#define ASIO_STANDALONE
35#include <websocketpp/config/asio_no_tls.hpp>
36#include <websocketpp/server.hpp>
46 m_endpoint.set_error_channels(websocketpp::log::elevel::all);
47 m_endpoint.set_access_channels(websocketpp::log::alevel::all ^ websocketpp::log::alevel::frame_payload);
50 m_endpoint.init_asio();
53 m_endpoint.set_message_handler(std::bind(
54 &utility_server::echo_handler,
this,
55 std::placeholders::_1, std::placeholders::_2
61 m_endpoint.send(hdl, msg->get_payload(), msg->get_opcode());
66 m_endpoint.listen(9002);
69 m_endpoint.start_accept();
Server endpoint role based on the given config.
Namespace for the WebSocket++ project.
lib::weak_ptr< void > connection_hdl
A handle to uniquely identify a connection.
Server config with asio transport and TLS disabled.