10using websocketpp::lib::placeholders::_1;
11using websocketpp::lib::placeholders::_2;
12using websocketpp::lib::bind;
21 "Text Message Received: "+msg->get_payload());
28 s->send(hdl, msg->get_payload(), msg->get_opcode());
29 }
catch (
const websocketpp::lib::error_code& e) {
31 "Echo Failed: "+e.message());
48 log.open(
"output.log");
49 s.get_alog().set_ostream(&log);
50 s.get_elog().set_ostream(&log);
53 s.register_ostream(&std::cout);
73 bool buffered_io =
false;
80 while(std::cin.get(
a)) {
86 std::cout << e.
what() << std::endl;
connection_type::message_ptr message_ptr
void close(connection_hdl hdl, close::status::value const code, std::string const &reason, lib::error_code &ec)
virtual char const * what() const
Server endpoint role based on the given config.
connection_type::ptr connection_ptr
websocketpp::config::asio_tls_client::message_type::ptr message_ptr
websocketpp::server< websocketpp::config::core > server
void on_message(server *s, websocketpp::connection_hdl hdl, message_ptr msg)
std::string to_hex(std::string const &input)
Convert std::string to ascii printed string of hex digits.
lib::weak_ptr< void > connection_hdl
A handle to uniquely identify a connection.
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
static level const all
Special aggregate value representing "all levels".
static level const connect
Information about new connections.
static level const app
Special channel for application specific logs. Not used by the library.
static level const disconnect
One line for each closed connection. Includes closing codes and reasons.