69 {
70
72
73 try {
74
75 if (argc > 1 && std::string(
argv[1]) ==
"-d") {
78 } else {
81 }
82
83
84 echo_server.init_asio();
85
86
87 using websocketpp::lib::placeholders::_1;
88 using websocketpp::lib::placeholders::_2;
90
91
92 echo_server.listen(9002);
93
94
96
97
98 echo_server.run();
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;
103 } catch (...) {
104 std::cout << "other exception" << std::endl;
105 }
106}
void set_message_handler(message_handler h)
void set_access_channels(log::level channels)
Set Access logging channel.
void set_error_channels(log::level channels)
Set Error logging channel.
void start_accept(lib::error_code &ec)
Starts the server's async connection acceptance loop (exception free)
void on_message(server *s, websocketpp::connection_hdl hdl, message_ptr msg)
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".