#include <rpc_manager.hpp>
Public Types | |
| typedef boost::function1< void, msg const & > | fun |
| typedef boost::function1< void, msg const & > | send_fun |
Public Member Functions | |
| rpc_manager (fun const &incoming_fun, node_id const &our_id, routing_table &table, send_fun const &sf) | |
| ~rpc_manager () | |
| bool | incoming (msg const &) |
| boost::posix_time::time_duration | tick () |
| void | invoke (int message_id, udp::endpoint target, boost::shared_ptr< observer > o) |
| void | reply (msg &m, msg const &reply_to) |
| void | reply_with_ping (msg &m, msg const &reply_to) |
| void | check_invariant () const |
Private Types | |
| enum | { max_transactions = 2048 } |
| typedef boost::array < boost::shared_ptr< observer > , max_transactions > | transactions_t |
Private Member Functions | |
| unsigned int | new_transaction_id (boost::shared_ptr< observer > o) |
| void | update_oldest_transaction_id () |
| boost::uint32_t | calc_connection_id (udp::endpoint addr) |
Private Attributes | |
| transactions_t | m_transactions |
| std::vector< boost::shared_ptr < observer > > | m_aborted_transactions |
| int | m_next_transaction_id |
| int | m_oldest_transaction_id |
| fun | m_incoming |
| send_fun | m_send |
| node_id | m_our_id |
| routing_table & | m_table |
| boost::posix_time::ptime | m_timer |
| node_id | m_random_number |
| bool | m_destructing |
Definition at line 144 of file rpc_manager.hpp.
| typedef boost::function1<void, msg const&> libtorrent::dht::rpc_manager::fun |
Definition at line 147 of file rpc_manager.hpp.
| typedef boost::function1<void, msg const&> libtorrent::dht::rpc_manager::send_fun |
Definition at line 148 of file rpc_manager.hpp.
typedef boost::array<boost::shared_ptr<observer>, max_transactions> libtorrent::dht::rpc_manager::transactions_t [private] |
Definition at line 178 of file rpc_manager.hpp.
anonymous enum [private] |
| libtorrent::dht::rpc_manager::rpc_manager | ( | fun const & | incoming_fun, | |
| node_id const & | our_id, | |||
| routing_table & | table, | |||
| send_fun const & | sf | |||
| ) |
Definition at line 40 of file rpc_manager.cpp.
| libtorrent::dht::rpc_manager::~rpc_manager | ( | ) |
Definition at line 55 of file rpc_manager.cpp.
References libtorrent::dht::observer::abort(), asio::detail::socket_ops::bind(), asio::placeholders::iterator, m_aborted_transactions, m_destructing, m_transactions, and TORRENT_LOG.
Definition at line 88 of file rpc_manager.cpp.
References libtorrent::dht::msg::addr, libtorrent::dht::msg::id, INVARIANT_CHECK, m_destructing, m_incoming, m_our_id, m_table, m_transactions, libtorrent::dht::msg::message_id, libtorrent::dht::routing_table::node_seen(), libtorrent::dht::msg::piggy_backed_ping, libtorrent::dht::messages::ping, libtorrent::dht::msg::ping_transaction_id, libtorrent::detail::read_uint16(), reply(), libtorrent::dht::msg::reply, TORRENT_LOG, and libtorrent::dht::msg::transaction_id.
Referenced by libtorrent::dht::node_impl::incoming().
| time_duration libtorrent::dht::rpc_manager::tick | ( | ) |
Definition at line 173 of file rpc_manager.cpp.
References asio::detail::socket_ops::bind(), INVARIANT_CHECK, m_aborted_transactions, m_next_transaction_id, m_oldest_transaction_id, m_transactions, max_transactions, and libtorrent::dht::observer::timeout().
Referenced by libtorrent::dht::node_impl::connection_timeout().
| void libtorrent::dht::rpc_manager::invoke | ( | int | message_id, | |
| udp::endpoint | target, | |||
| boost::shared_ptr< observer > | o | |||
| ) |
Definition at line 311 of file rpc_manager.cpp.
References libtorrent::dht::msg::addr, libtorrent::dht::messages::error, libtorrent::dht::msg::id, INVARIANT_CHECK, m_destructing, m_our_id, m_send, libtorrent::dht::msg::message_id, libtorrent::dht::msg::piggy_backed_ping, libtorrent::dht::msg::reply, and libtorrent::dht::msg::transaction_id.
Referenced by incoming(), and libtorrent::dht::node_impl::incoming_request().
Definition at line 339 of file rpc_manager.cpp.
References libtorrent::dht::msg::addr, libtorrent::dht::messages::error, libtorrent::dht::msg::id, INVARIANT_CHECK, m_destructing, m_our_id, m_send, m_transactions, libtorrent::dht::msg::message_id, new_transaction_id(), libtorrent::dht::msg::piggy_backed_ping, libtorrent::dht::msg::ping_transaction_id, libtorrent::dht::msg::reply, libtorrent::dht::msg::transaction_id, and libtorrent::detail::write_uint16().
Referenced by libtorrent::dht::node_impl::incoming_request().
| void libtorrent::dht::rpc_manager::check_invariant | ( | ) | const |
Definition at line 72 of file rpc_manager.cpp.
References m_next_transaction_id, m_oldest_transaction_id, m_transactions, and max_transactions.
| unsigned int libtorrent::dht::rpc_manager::new_transaction_id | ( | boost::shared_ptr< observer > | o | ) | [private] |
Referenced by reply_with_ping().
| void libtorrent::dht::rpc_manager::update_oldest_transaction_id | ( | ) | [private] |
Definition at line 251 of file rpc_manager.cpp.
References INVARIANT_CHECK, m_oldest_transaction_id, m_transactions, and max_transactions.
| boost::uint32_t libtorrent::dht::rpc_manager::calc_connection_id | ( | udp::endpoint | addr | ) | [private] |
Definition at line 179 of file rpc_manager.hpp.
Referenced by check_invariant(), incoming(), reply_with_ping(), tick(), update_oldest_transaction_id(), and ~rpc_manager().
std::vector<boost::shared_ptr<observer> > libtorrent::dht::rpc_manager::m_aborted_transactions [private] |
int libtorrent::dht::rpc_manager::m_next_transaction_id [private] |
int libtorrent::dht::rpc_manager::m_oldest_transaction_id [private] |
Definition at line 188 of file rpc_manager.hpp.
Referenced by check_invariant(), tick(), and update_oldest_transaction_id().
fun libtorrent::dht::rpc_manager::m_incoming [private] |
send_fun libtorrent::dht::rpc_manager::m_send [private] |
Definition at line 192 of file rpc_manager.hpp.
Referenced by incoming(), reply(), and reply_with_ping().
boost::posix_time::ptime libtorrent::dht::rpc_manager::m_timer [private] |
Definition at line 194 of file rpc_manager.hpp.
Definition at line 195 of file rpc_manager.hpp.
Definition at line 196 of file rpc_manager.hpp.
Referenced by incoming(), reply(), reply_with_ping(), and ~rpc_manager().
1.5.6