35using websocketpp::lib::placeholders::_1;
36using websocketpp::lib::placeholders::_2;
37using websocketpp::lib::bind;
45 std::cout <<
"on_message called with hdl: " << hdl.lock().get()
46 <<
" and message: " << msg->get_payload()
50 websocketpp::lib::error_code ec;
52 c->
send(hdl, msg->get_payload(), msg->get_opcode(), ec);
54 std::cout <<
"Echo failed because: " << ec.message() << std::endl;
62 std::string uri =
"ws://localhost:9002";
79 websocketpp::lib::error_code ec;
82 std::cout <<
"could not create connection because: " << ec.message() << std::endl;
95 std::cout << e.
what() << std::endl;
Client endpoint role based on the given config.
connection_ptr connect(connection_ptr con)
Begin the connection process for the given connection.
connection_ptr get_connection(uri_ptr location, lib::error_code &ec)
Get a new connection.
connection_type::ptr connection_ptr
void set_message_handler(message_handler h)
void clear_access_channels(log::level channels)
Clear Access logging channels.
void send(connection_hdl hdl, std::string const &payload, frame::opcode::value op, lib::error_code &ec)
Create a message and add it to the outgoing send queue (exception free)
void set_access_channels(log::level channels)
Set Access logging channel.
virtual char const * what() const
lib::shared_ptr< message > ptr
websocketpp::config::asio_tls_client::message_type::ptr message_ptr
void on_message(client *c, websocketpp::connection_hdl hdl, message_ptr msg)
websocketpp::config::asio_client::message_type::ptr message_ptr
websocketpp::client< websocketpp::config::asio_client > client
lib::weak_ptr< void > connection_hdl
A handle to uniquely identify a connection.
static level const all
Special aggregate value representing "all levels".
static level const frame_payload
One line per frame, includes the full message payload (warning: chatty)