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 15 of file telemetry_client.cpp.
Definition at line 17 of file telemetry_client.cpp.
typedef websocketpp::lib::lock_guard<websocketpp::lib::mutex> telemetry_client::scoped_lock |
Definition at line 18 of file telemetry_client.cpp.
|
inline |
Definition at line 20 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, websocketpp::transport::asio::endpoint< config >::init_asio(), 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 39 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(), websocketpp::transport::asio::endpoint< config >::run(), telemetry_loop(), and websocketpp::log::stub::write().
Referenced by main().
|
inline |
Definition at line 68 of file telemetry_client.cpp.
References websocketpp::log::alevel::app, websocketpp::endpoint< connection, config >::get_alog(), and websocketpp::log::stub::write().
Referenced by telemetry_client().
|
inline |
Definition at line 77 of file telemetry_client.cpp.
References websocketpp::log::alevel::app, websocketpp::endpoint< connection, config >::get_alog(), and websocketpp::log::stub::write().
Referenced by telemetry_client().
|
inline |
Definition at line 86 of file telemetry_client.cpp.
References websocketpp::log::alevel::app, websocketpp::endpoint< connection, config >::get_alog(), and websocketpp::log::stub::write().
Referenced by telemetry_client().
|
inline |
Definition at line 94 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 websocketpp::log::stub::write().
Referenced by run().