18 typedef websocketpp::lib::lock_guard<websocketpp::lib::mutex>
scoped_lock;
31 using websocketpp::lib::placeholders::_1;
32 using websocketpp::lib::bind;
39 void run(
const std::string & uri) {
41 websocketpp::lib::error_code ec;
45 "Get Connection Error: "+ec.message());
51 m_hdl = con->get_handle();
58 websocketpp::lib::thread asio_thread(&client::run, &m_client);
64 telemetry_thread.join();
70 "Connection opened, starting telemetry!");
79 "Connection closed, stopping telemetry!");
88 "Connection failed, stopping telemetry!");
96 std::stringstream val;
97 websocketpp::lib::error_code ec;
119 val <<
"count is " <<
count++;
131 "Send Error: "+ec.message());
141 websocketpp::lib::mutex m_lock;
149 std::string uri =
"ws://localhost:9002";
void on_open(websocketpp::connection_hdl)
void on_close(websocketpp::connection_hdl)
websocketpp::client< websocketpp::config::asio_client > client
void run(const std::string &uri)
websocketpp::lib::lock_guard< websocketpp::lib::mutex > scoped_lock
void on_fail(websocketpp::connection_hdl)
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_fail_handler(fail_handler h)
alog_type & get_alog()
Get reference to access logger.
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_open_handler(open_handler h)
void set_access_channels(log::level channels)
Set Access logging channel.
void set_close_handler(close_handler h)
lib::weak_ptr< void > connection_hdl
A handle to uniquely identify a connection.
unsigned __int64 uint64_t
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.