The telemetry client connects to a WebSocket server and sends a message every second containing an integer count. More...
Public Types | |
typedef websocketpp::client< websocketpp::config::asio_client > | client |
typedef websocketpp::lib::lock_guard< websocketpp::lib::mutex > | scoped_lock |
Public Member Functions | |
telemetry_client () | |
void | run (const std::string &uri) |
void | on_open (websocketpp::connection_hdl) |
void | on_close (websocketpp::connection_hdl) |
void | on_fail (websocketpp::connection_hdl) |
void | telemetry_loop () |
The telemetry client connects to a WebSocket server and sends a message every second containing an integer count.
This example can be used as the basis for programs where a client connects and pushes data for logging, stress/load testing, etc.
Definition at line 26 of file telemetry_client.cpp.
Definition at line 28 of file telemetry_client.cpp.
typedef websocketpp::lib::lock_guard<websocketpp::lib::mutex> telemetry_client::scoped_lock |
Definition at line 29 of file telemetry_client.cpp.
|
inline |
Definition at line 31 of file telemetry_client.cpp.
References websocketpp::log::alevel::all, websocketpp::log::alevel::app, websocketpp::endpoint< connection, config >::clear_access_channels(), websocketpp::log::alevel::connect, websocketpp::log::alevel::disconnect, on_close(), on_fail(), on_open(), websocketpp::endpoint< connection, config >::set_access_channels(), websocketpp::endpoint< connection, config >::set_close_handler(), websocketpp::endpoint< connection, config >::set_fail_handler(), and websocketpp::endpoint< connection, config >::set_open_handler().
|
inline |
Definition at line 50 of file telemetry_client.cpp.
References websocketpp::log::alevel::app, websocketpp::client< config >::connect(), websocketpp::endpoint< connection, config >::get_alog(), websocketpp::client< config >::get_connection(), and telemetry_loop().
Referenced by main().
|
inline |
Definition at line 79 of file telemetry_client.cpp.
References websocketpp::log::alevel::app, and websocketpp::endpoint< connection, config >::get_alog().
Referenced by telemetry_client().
|
inline |
Definition at line 88 of file telemetry_client.cpp.
References websocketpp::log::alevel::app, and websocketpp::endpoint< connection, config >::get_alog().
Referenced by telemetry_client().
|
inline |
Definition at line 97 of file telemetry_client.cpp.
References websocketpp::log::alevel::app, and websocketpp::endpoint< connection, config >::get_alog().
Referenced by telemetry_client().
|
inline |
Definition at line 105 of file telemetry_client.cpp.
References websocketpp::log::alevel::app, websocketpp::endpoint< connection, config >::get_alog(), websocketpp::endpoint< connection, config >::send(), websocketpp::frame::opcode::text, and wait_a_bit().
Referenced by run().