Bytemaster's Boost Libraries
|
JSON-RPC connection interface. More...
#include <connection.hpp>
Public Types | |
typedef boost::cmt::retainable_ptr < connection > | ptr |
typedef boost::function< void(const boost::json::Value &, boost::json::Value &)> | handler |
Public Member Functions | |
void | add_signal_connection (const std::string &name, const boost::signals::connection &c) |
void | add_method_handler (const std::string &name, const handler &h) |
void | invoke (boost::json::Value &msg, boost::json::Value &rtn_msg, const boost::chrono::microseconds &timeout_us=boost::chrono::microseconds::max()) |
virtual void | send (const boost::json::Value &v)=0 |
virtual void | start ()=0 |
virtual bool | is_connected () const =0 |
Public Attributes | |
boost::signal< void()> | disconnected |
Protected Member Functions | |
void | on_receive (const boost::json::Value &v) |
JSON-RPC connection interface.
This class serves as the base class for various transports such as TCP, UDP, etc and provides a common interface as well as default implementation of common state-handling logic such as waiting for return values and managing signal connections.