62 s->send(hdl, msg->get_payload(), msg->get_opcode());
63 }
catch (
const websocketpp::lib::error_code& e) {
64 std::cout <<
"Echo failed because: " << e
65 <<
"(" << e.message() <<
")" << std::endl;
75 if (argc > 1 && std::string(
argv[1]) ==
"-d") {
84 echo_server.init_asio();
87 using websocketpp::lib::placeholders::_1;
88 using websocketpp::lib::placeholders::_2;
92 echo_server.listen(9002);
99 }
catch (
const std::exception & e) {
100 std::cout << e.what() << std::endl;
101 }
catch (websocketpp::lib::error_code e) {
102 std::cout << e.message() << std::endl;
104 std::cout <<
"other exception" << std::endl;
void set_message_handler(message_handler h)
void set_access_channels(log::level channels)
Set Access logging channel.
connection_type::message_ptr message_ptr
void set_error_channels(log::level channels)
Set Error logging channel.
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)
Basic ASIO endpoint socket component.
Asio based endpoint transport component.
websocketpp::config::asio_tls_client::message_type::ptr message_ptr
lib::weak_ptr< void > connection_hdl
A handle to uniquely identify a connection.
websocketpp::server< deflate_config > server
void on_message(server *s, websocketpp::connection_hdl hdl, message_ptr msg)
permessage_compress extension
type::alog_type alog_type
type::concurrency_type concurrency_type
type::elog_type elog_type
type::response_type response_type
websocketpp::transport::asio::basic_socket::endpoint socket_type
type::request_type request_type
base::concurrency_type concurrency_type
websocketpp::transport::asio::endpoint< transport_config > transport_type
base::elog_type elog_type
base::con_msg_manager_type con_msg_manager_type
base::endpoint_msg_manager_type endpoint_msg_manager_type
websocketpp::extensions::permessage_deflate::enabled< permessage_deflate_config > permessage_deflate_type
base::alog_type alog_type
base::request_type request_type
base::response_type response_type
base::message_type message_type
Client/Server debug config with iostream transport.
static level const none
Special aggregate value representing "no levels".
static level const all
Special aggregate value representing "all levels".
static level const all
Special aggregate value representing "all levels".
static level const none
Special aggregate value representing "no levels".