18 #ifndef INCLUDED_RPC_CLIENT_HPP 19 #define INCLUDED_RPC_CLIENT_HPP 21 #include <boost/asio.hpp> 22 #include <boost/smart_ptr.hpp> 23 #include <boost/thread/thread.hpp> 24 #include <boost/thread/condition_variable.hpp> 28 namespace uhd {
namespace usrprio_rpc {
37 const std::string& server,
38 const std::string& port,
39 boost::uint32_t process_id,
40 boost::uint32_t host_id);
43 const boost::system::error_code&
call(
47 boost::posix_time::milliseconds timeout);
49 inline const boost::system::error_code&
status()
const {
62 void _handle_response_hdr(
const boost::system::error_code& err,
size_t transferred,
size_t expected);
63 void _handle_response_data(
const boost::system::error_code& err,
size_t transferred,
size_t expected);
64 void _wait_for_next_response_header();
66 inline void _stop_io_service() {
67 if (_io_service_thread.get()) {
68 UHD_LOG <<
"rpc_client stopping..." << std::endl;
70 _io_service_thread->join();
71 _io_service_thread.reset();
72 UHD_LOG <<
"rpc_client stopped." << std::endl;
77 boost::asio::io_service _io_service;
78 boost::scoped_ptr<boost::thread> _io_service_thread;
79 boost::asio::ip::tcp::socket _socket;
88 boost::condition_variable _exec_gate;
89 boost::system::error_code _exec_err;
Definition: rpc_common.hpp:76
Definition: rpc_client.hpp:30
Definition: rpc_common.hpp:107
const boost::system::error_code & status() const
Definition: rpc_client.hpp:49
Definition: rpc_common.hpp:49
rpc_client(const std::string &server, const std::string &port, boost::uint32_t process_id, boost::uint32_t host_id)
static const boost::uint32_t OLDEST_COMPATIBLE_VERSION
Definition: rpc_client.hpp:34
Definition: convert.hpp:28
static const boost::uint32_t CURRENT_VERSION
Definition: rpc_client.hpp:33
boost::int32_t func_id_t
Definition: rpc_common.hpp:38
#define UHD_LOG
Definition: log.hpp:66
const boost::system::error_code & call(func_id_t func_id, const func_args_writer_t &in_args, func_args_reader_t &out_args, boost::posix_time::milliseconds timeout)
Definition: rpc_common.hpp:69