#include <bt_peer_connection.hpp>

Public Types | |
| enum | message_type { msg_choke = 0, msg_unchoke, msg_interested, msg_not_interested, msg_have, msg_bitfield, msg_request, msg_piece, msg_cancel, msg_dht_port, msg_extended = 20, num_supported_messages } |
| typedef void(bt_peer_connection::* | message_handler )(int received) |
Public Member Functions | |
| bt_peer_connection (aux::session_impl &ses, boost::weak_ptr< torrent > t, boost::shared_ptr< stream_socket > s, tcp::endpoint const &remote) | |
| bt_peer_connection (aux::session_impl &ses, boost::shared_ptr< stream_socket > s) | |
| ~bt_peer_connection () | |
| void | on_sent (asio::error_code const &error, std::size_t bytes_transferred) |
| void | on_receive (asio::error_code const &error, std::size_t bytes_transferred) |
| virtual void | get_peer_info (peer_info &p) const |
| virtual bool | in_handshake () const |
| bool | support_extensions () const |
| template<class T> | |
| T * | supports_extension () const |
| void | on_keepalive () |
| void | on_choke (int received) |
| void | on_unchoke (int received) |
| void | on_interested (int received) |
| void | on_not_interested (int received) |
| void | on_have (int received) |
| void | on_bitfield (int received) |
| void | on_request (int received) |
| void | on_piece (int received) |
| void | on_cancel (int received) |
| void | on_dht_port (int received) |
| void | on_extended (int received) |
| void | on_extended_handshake () |
| void | write_choke () |
| void | write_unchoke () |
| void | write_interested () |
| void | write_not_interested () |
| void | write_request (peer_request const &r) |
| void | write_cancel (peer_request const &r) |
| void | write_bitfield (std::vector< bool > const &bitfield) |
| void | write_have (int index) |
| void | write_piece (peer_request const &r) |
| void | write_handshake () |
| void | write_extensions () |
| void | write_chat_message (const std::string &msg) |
| void | write_metadata (std::pair< int, int > req) |
| void | write_metadata_request (std::pair< int, int > req) |
| void | write_keepalive () |
| void | write_dht_port (int listen_port) |
| void | on_connected () |
| void | on_metadata () |
| void | check_invariant () const |
Public Attributes | |
| boost::posix_time::ptime | m_last_choke |
Private Types | |
| enum | state { read_protocol_length = 0, read_protocol_string, read_info_hash, read_peer_id, read_packet_size, read_packet } |
Private Member Functions | |
| bool | dispatch_message (int received) |
| boost::optional < piece_block_progress > | downloading_piece_progress () const |
Static Private Member Functions | |
| static bool | range_below_zero (const range &r) |
Private Attributes | |
| std::string | m_client_version |
| state | m_state |
| int | m_timeout |
| std::deque< range > | m_payloads |
| bool | m_supports_extensions |
| bool | m_supports_dht_port |
| bool | m_sent_bitfield |
| bool | m_in_constructor |
Static Private Attributes | |
| static const message_handler | m_message_handler [num_supported_messages] |
Friends | |
| class | invariant_access |
Classes | |
| struct | range |
Definition at line 82 of file bt_peer_connection.hpp.
| typedef void(bt_peer_connection::* libtorrent::bt_peer_connection::message_handler)(int received) |
| msg_choke | |
| msg_unchoke | |
| msg_interested | |
| msg_not_interested | |
| msg_have | |
| msg_bitfield | |
| msg_request | |
| msg_piece | |
| msg_cancel | |
| msg_dht_port | |
| msg_extended | |
| num_supported_messages |
Definition at line 105 of file bt_peer_connection.hpp.
enum libtorrent::bt_peer_connection::state [private] |
| read_protocol_length | |
| read_protocol_string | |
| read_info_hash | |
| read_peer_id | |
| read_packet_size | |
| read_packet |
Definition at line 215 of file bt_peer_connection.hpp.
| libtorrent::bt_peer_connection::bt_peer_connection | ( | aux::session_impl & | ses, | |
| boost::weak_ptr< torrent > | t, | |||
| boost::shared_ptr< stream_socket > | s, | |||
| tcp::endpoint const & | remote | |||
| ) |
| libtorrent::bt_peer_connection::bt_peer_connection | ( | aux::session_impl & | ses, | |
| boost::shared_ptr< stream_socket > | s | |||
| ) |
Definition at line 91 of file bt_peer_connection.cpp.
References libtorrent::bandwidth_limit::assign(), libtorrent::peer_connection::download_channel, libtorrent::peer_connection::m_bandwidth_limit, m_in_constructor, libtorrent::peer_connection::reset_recv_buffer(), libtorrent::peer_connection::setup_receive(), and libtorrent::peer_connection::upload_channel.
| libtorrent::bt_peer_connection::~bt_peer_connection | ( | ) |
Definition at line 125 of file bt_peer_connection.cpp.
| void libtorrent::bt_peer_connection::on_sent | ( | asio::error_code const & | error, | |
| std::size_t | bytes_transferred | |||
| ) | [virtual] |
Implements libtorrent::peer_connection.
Definition at line 1352 of file bt_peer_connection.cpp.
References INVARIANT_CHECK, asio::placeholders::iterator, m_payloads, libtorrent::peer_connection::m_statistics, range_below_zero(), and libtorrent::stat::sent_bytes().
| void libtorrent::bt_peer_connection::on_receive | ( | asio::error_code const & | error, | |
| std::size_t | bytes_transferred | |||
| ) | [virtual] |
Implements libtorrent::peer_connection.
Definition at line 1057 of file bt_peer_connection.cpp.
References libtorrent::peer_connection::associated_torrent(), libtorrent::peer_connection::attach_to_torrent(), libtorrent::big_number::begin(), libtorrent::buffer::const_interval::begin, libtorrent::policy::begin_peer(), asio::buffer(), libtorrent::client_fingerprint(), dispatch_message(), libtorrent::big_number::end(), libtorrent::buffer::const_interval::end, libtorrent::policy::end_peer(), libtorrent::aux::session_impl::get_peer_id(), libtorrent::peer_connection::get_socket(), libtorrent::identify_client(), libtorrent::peer_connection::incoming_keepalive(), INVARIANT_CHECK, libtorrent::peer_connection::is_local(), asio::placeholders::iterator, libtorrent::aux::session_impl::kad_settings(), LIBTORRENT_VERSION, m_client_version, libtorrent::aux::session_impl::m_dht, libtorrent::peer_connection::m_extensions, libtorrent::peer_connection::m_max_out_request_queue, libtorrent::peer_connection::m_ses, m_state, libtorrent::peer_connection::m_statistics, m_supports_dht_port, m_supports_extensions, libtorrent::peer_connection::packet_finished(), libtorrent::peer_connection::packet_size(), libtorrent::peer_connection::pid(), read_info_hash, libtorrent::detail::read_int32(), read_packet, read_packet_size, read_peer_id, read_protocol_length, read_protocol_string, libtorrent::peer_connection::receive_buffer(), libtorrent::stat::received_bytes(), libtorrent::peer_connection::reset_recv_buffer(), libtorrent::dht_settings::service_port, libtorrent::peer_connection::set_pid(), asio::write(), write_bitfield(), write_dht_port(), write_extensions(), and write_handshake().
| void libtorrent::bt_peer_connection::get_peer_info | ( | peer_info & | p | ) | const [virtual] |
Implements libtorrent::peer_connection.
Definition at line 148 of file bt_peer_connection.cpp.
References libtorrent::peer_connection::associated_torrent(), libtorrent::peer_info::choked, libtorrent::peer_info::client, libtorrent::peer_info::connecting, libtorrent::peer_info::connection_type, libtorrent::peer_info::country, libtorrent::peer_info::down_speed, libtorrent::peer_connection::download_channel, libtorrent::peer_info::download_limit, libtorrent::stat::download_payload_rate(), libtorrent::peer_connection::download_queue(), libtorrent::peer_info::download_queue_length, libtorrent::stat::download_rate(), libtorrent::peer_info::downloading_block_index, libtorrent::peer_info::downloading_piece_index, downloading_piece_progress(), libtorrent::peer_info::downloading_progress, libtorrent::peer_info::downloading_total, libtorrent::peer_info::flags, libtorrent::peer_connection::get_bitfield(), libtorrent::peer_info::handshake, libtorrent::peer_connection::has_peer_choked(), libtorrent::bandwidth_limit::inf, libtorrent::peer_info::interesting, libtorrent::peer_info::ip, libtorrent::peer_connection::is_choked(), libtorrent::peer_connection::is_connecting(), libtorrent::peer_connection::is_interesting(), libtorrent::peer_connection::is_local(), libtorrent::peer_connection::is_peer_interested(), libtorrent::peer_connection::is_queued(), libtorrent::peer_connection::is_seed(), libtorrent::peer_info::load_balancing, libtorrent::peer_info::local_connection, libtorrent::peer_connection::m_bandwidth_limit, m_client_version, libtorrent::peer_connection::m_country, m_state, libtorrent::peer_info::payload_down_speed, libtorrent::peer_info::payload_up_speed, libtorrent::peer_connection::pid(), libtorrent::peer_info::pid, libtorrent::peer_info::pieces, libtorrent::peer_info::queued, read_packet_size, libtorrent::peer_connection::remote(), libtorrent::peer_info::remote_choked, libtorrent::peer_info::remote_interested, libtorrent::peer_info::seed, libtorrent::peer_info::standard_bittorrent, libtorrent::peer_connection::statistics(), support_extensions(), libtorrent::peer_info::supports_extensions, libtorrent::bandwidth_limit::throttle(), libtorrent::peer_info::total_download, libtorrent::peer_connection::total_free_upload(), libtorrent::stat::total_payload_download(), libtorrent::stat::total_payload_upload(), libtorrent::peer_info::total_upload, libtorrent::peer_info::up_speed, libtorrent::peer_connection::upload_channel, libtorrent::peer_info::upload_limit, libtorrent::stat::upload_payload_rate(), libtorrent::peer_connection::upload_queue(), libtorrent::peer_info::upload_queue_length, and libtorrent::stat::upload_rate().
| bool libtorrent::bt_peer_connection::in_handshake | ( | ) | const [virtual] |
Implements libtorrent::peer_connection.
Definition at line 214 of file bt_peer_connection.cpp.
References m_state, and read_packet_size.
| bool libtorrent::bt_peer_connection::support_extensions | ( | ) | const [inline] |
| T* libtorrent::bt_peer_connection::supports_extension | ( | ) | const [inline] |
Definition at line 139 of file bt_peer_connection.hpp.
| void libtorrent::bt_peer_connection::on_keepalive | ( | ) |
Definition at line 316 of file bt_peer_connection.cpp.
References libtorrent::peer_connection::incoming_keepalive(), and INVARIANT_CHECK.
| void libtorrent::bt_peer_connection::on_choke | ( | int | received | ) |
Definition at line 332 of file bt_peer_connection.cpp.
References libtorrent::peer_connection::incoming_choke(), INVARIANT_CHECK, asio::placeholders::iterator, libtorrent::peer_connection::m_extensions, libtorrent::peer_connection::m_statistics, libtorrent::peer_connection::packet_finished(), libtorrent::peer_connection::packet_size(), and libtorrent::stat::received_bytes().
| void libtorrent::bt_peer_connection::on_unchoke | ( | int | received | ) |
Definition at line 357 of file bt_peer_connection.cpp.
References libtorrent::peer_connection::incoming_unchoke(), INVARIANT_CHECK, asio::placeholders::iterator, libtorrent::peer_connection::m_extensions, libtorrent::peer_connection::m_statistics, libtorrent::peer_connection::packet_finished(), libtorrent::peer_connection::packet_size(), and libtorrent::stat::received_bytes().
| void libtorrent::bt_peer_connection::on_interested | ( | int | received | ) |
Definition at line 382 of file bt_peer_connection.cpp.
References libtorrent::peer_connection::incoming_interested(), INVARIANT_CHECK, asio::placeholders::iterator, libtorrent::peer_connection::m_extensions, libtorrent::peer_connection::m_statistics, libtorrent::peer_connection::packet_finished(), libtorrent::peer_connection::packet_size(), and libtorrent::stat::received_bytes().
| void libtorrent::bt_peer_connection::on_not_interested | ( | int | received | ) |
Definition at line 407 of file bt_peer_connection.cpp.
References libtorrent::peer_connection::incoming_not_interested(), INVARIANT_CHECK, asio::placeholders::iterator, libtorrent::peer_connection::m_extensions, libtorrent::peer_connection::m_statistics, libtorrent::peer_connection::packet_finished(), libtorrent::peer_connection::packet_size(), and libtorrent::stat::received_bytes().
| void libtorrent::bt_peer_connection::on_have | ( | int | received | ) |
Definition at line 432 of file bt_peer_connection.cpp.
References libtorrent::buffer::const_interval::begin, libtorrent::peer_connection::incoming_have(), index, INVARIANT_CHECK, asio::placeholders::iterator, libtorrent::peer_connection::m_extensions, libtorrent::peer_connection::m_statistics, libtorrent::peer_connection::packet_finished(), libtorrent::peer_connection::packet_size(), libtorrent::detail::read_int32(), libtorrent::peer_connection::receive_buffer(), and libtorrent::stat::received_bytes().
| void libtorrent::bt_peer_connection::on_bitfield | ( | int | received | ) |
Definition at line 462 of file bt_peer_connection.cpp.
References libtorrent::peer_connection::associated_torrent(), libtorrent::peer_connection::get_bitfield(), libtorrent::peer_connection::incoming_bitfield(), INVARIANT_CHECK, asio::placeholders::iterator, libtorrent::peer_connection::m_extensions, libtorrent::peer_connection::m_statistics, libtorrent::peer_connection::packet_finished(), libtorrent::peer_connection::packet_size(), libtorrent::peer_connection::receive_buffer(), and libtorrent::stat::received_bytes().
| void libtorrent::bt_peer_connection::on_request | ( | int | received | ) |
Definition at line 511 of file bt_peer_connection.cpp.
References libtorrent::buffer::const_interval::begin, libtorrent::peer_connection::incoming_request(), INVARIANT_CHECK, asio::placeholders::iterator, libtorrent::peer_request::length, libtorrent::peer_connection::m_extensions, libtorrent::peer_connection::m_statistics, libtorrent::peer_connection::packet_finished(), libtorrent::peer_connection::packet_size(), libtorrent::peer_request::piece, libtorrent::detail::read_int32(), libtorrent::peer_connection::receive_buffer(), libtorrent::stat::received_bytes(), and libtorrent::peer_request::start.
| void libtorrent::bt_peer_connection::on_piece | ( | int | received | ) |
Definition at line 544 of file bt_peer_connection.cpp.
References libtorrent::buffer::const_interval::begin, libtorrent::buffer::const_interval::end, libtorrent::peer_connection::incoming_piece(), libtorrent::peer_connection::incoming_piece_fragment(), INVARIANT_CHECK, asio::placeholders::iterator, libtorrent::peer_request::length, libtorrent::peer_connection::m_extensions, libtorrent::peer_connection::m_statistics, libtorrent::peer_connection::packet_finished(), libtorrent::peer_connection::packet_size(), libtorrent::peer_request::piece, libtorrent::detail::read_int32(), libtorrent::peer_connection::receive_buffer(), libtorrent::stat::received_bytes(), and libtorrent::peer_request::start.
| void libtorrent::bt_peer_connection::on_cancel | ( | int | received | ) |
Definition at line 596 of file bt_peer_connection.cpp.
References libtorrent::buffer::const_interval::begin, libtorrent::peer_connection::incoming_cancel(), INVARIANT_CHECK, asio::placeholders::iterator, libtorrent::peer_request::length, libtorrent::peer_connection::m_extensions, libtorrent::peer_connection::m_statistics, libtorrent::peer_connection::packet_finished(), libtorrent::peer_connection::packet_size(), libtorrent::peer_request::piece, libtorrent::detail::read_int32(), libtorrent::peer_connection::receive_buffer(), libtorrent::stat::received_bytes(), and libtorrent::peer_request::start.
| void libtorrent::bt_peer_connection::on_dht_port | ( | int | received | ) |
Definition at line 629 of file bt_peer_connection.cpp.
References libtorrent::buffer::const_interval::begin, libtorrent::peer_connection::incoming_dht_port(), INVARIANT_CHECK, libtorrent::peer_connection::m_statistics, libtorrent::peer_connection::packet_finished(), libtorrent::peer_connection::packet_size(), libtorrent::detail::read_uint16(), libtorrent::peer_connection::receive_buffer(), and libtorrent::stat::received_bytes().
| void libtorrent::bt_peer_connection::on_extended | ( | int | received | ) |
Definition at line 651 of file bt_peer_connection.cpp.
References libtorrent::peer_connection::associated_torrent(), libtorrent::buffer::const_interval::begin, INVARIANT_CHECK, asio::placeholders::iterator, libtorrent::buffer::const_interval::left(), libtorrent::peer_connection::m_extensions, libtorrent::peer_connection::m_statistics, msg_extended, on_extended_handshake(), libtorrent::peer_connection::packet_size(), libtorrent::detail::read_uint8(), libtorrent::peer_connection::receive_buffer(), and libtorrent::stat::received_bytes().
| void libtorrent::bt_peer_connection::on_extended_handshake | ( | ) |
Definition at line 691 of file bt_peer_connection.cpp.
References libtorrent::peer_connection::associated_torrent(), libtorrent::bdecode(), libtorrent::buffer::const_interval::begin, libtorrent::buffer::const_interval::end, libtorrent::entry::find_key(), libtorrent::entry::int_t, asio::placeholders::iterator, m_client_version, libtorrent::peer_connection::m_extensions, libtorrent::peer_connection::m_max_out_request_queue, libtorrent::peer_connection::packet_finished(), libtorrent::peer_connection::pid(), libtorrent::entry::print(), libtorrent::peer_connection::receive_buffer(), libtorrent::peer_connection::remote(), and libtorrent::entry::string_t.
Referenced by on_extended().
| void libtorrent::bt_peer_connection::write_choke | ( | ) | [virtual] |
Implements libtorrent::peer_connection.
Definition at line 959 of file bt_peer_connection.cpp.
References INVARIANT_CHECK, libtorrent::peer_connection::is_choked(), msg_choke, and libtorrent::peer_connection::send_buffer().
| void libtorrent::bt_peer_connection::write_unchoke | ( | ) | [virtual] |
Implements libtorrent::peer_connection.
Definition at line 968 of file bt_peer_connection.cpp.
References INVARIANT_CHECK, msg_unchoke, and libtorrent::peer_connection::send_buffer().
| void libtorrent::bt_peer_connection::write_interested | ( | ) | [virtual] |
Implements libtorrent::peer_connection.
Definition at line 976 of file bt_peer_connection.cpp.
References INVARIANT_CHECK, msg_interested, and libtorrent::peer_connection::send_buffer().
| void libtorrent::bt_peer_connection::write_not_interested | ( | ) | [virtual] |
Implements libtorrent::peer_connection.
Definition at line 984 of file bt_peer_connection.cpp.
References INVARIANT_CHECK, msg_not_interested, and libtorrent::peer_connection::send_buffer().
| void libtorrent::bt_peer_connection::write_request | ( | peer_request const & | r | ) | [virtual] |
Implements libtorrent::peer_connection.
Definition at line 832 of file bt_peer_connection.cpp.
References libtorrent::peer_connection::allocate_send_buffer(), libtorrent::peer_connection::associated_torrent(), libtorrent::buffer::interval::begin, libtorrent::buffer::interval::end, INVARIANT_CHECK, libtorrent::peer_request::length, msg_request, libtorrent::peer_request::piece, libtorrent::peer_connection::setup_send(), libtorrent::peer_request::start, and libtorrent::detail::write_int32().
| void libtorrent::bt_peer_connection::write_cancel | ( | peer_request const & | r | ) | [virtual] |
Implements libtorrent::peer_connection.
Definition at line 808 of file bt_peer_connection.cpp.
References libtorrent::peer_connection::allocate_send_buffer(), libtorrent::peer_connection::associated_torrent(), libtorrent::buffer::interval::begin, libtorrent::buffer::interval::end, INVARIANT_CHECK, libtorrent::peer_request::length, msg_cancel, libtorrent::peer_request::piece, libtorrent::peer_connection::setup_send(), libtorrent::peer_request::start, and libtorrent::detail::write_int32().
| void libtorrent::bt_peer_connection::write_bitfield | ( | std::vector< bool > const & | bitfield | ) |
Definition at line 856 of file bt_peer_connection.cpp.
References libtorrent::peer_connection::allocate_send_buffer(), libtorrent::peer_connection::associated_torrent(), libtorrent::buffer::interval::begin, c, libtorrent::buffer::interval::end, libtorrent::peer_connection::get_bitfield(), INVARIANT_CHECK, m_sent_bitfield, msg_bitfield, libtorrent::peer_connection::packet_size(), libtorrent::peer_connection::setup_send(), libtorrent::detail::write_int32(), and libtorrent::detail::write_uint8().
Referenced by on_metadata(), and on_receive().
| void libtorrent::bt_peer_connection::write_have | ( | int | index | ) | [virtual] |
Implements libtorrent::peer_connection.
Definition at line 992 of file bt_peer_connection.cpp.
References libtorrent::peer_connection::associated_torrent(), INVARIANT_CHECK, msg_have, libtorrent::peer_connection::packet_size(), libtorrent::peer_connection::send_buffer(), and libtorrent::detail::write_int32().
| void libtorrent::bt_peer_connection::write_piece | ( | peer_request const & | r | ) | [virtual] |
Implements libtorrent::peer_connection.
Definition at line 1006 of file bt_peer_connection.cpp.
References libtorrent::peer_connection::allocate_send_buffer(), libtorrent::peer_connection::associated_torrent(), libtorrent::buffer::interval::begin, libtorrent::buffer::interval::end, INVARIANT_CHECK, libtorrent::peer_request::length, m_payloads, msg_piece, libtorrent::peer_connection::packet_size(), libtorrent::peer_request::piece, libtorrent::peer_connection::send_buffer_size(), libtorrent::peer_connection::setup_send(), libtorrent::peer_request::start, libtorrent::detail::write_int32(), and libtorrent::detail::write_uint8().
| void libtorrent::bt_peer_connection::write_handshake | ( | ) |
Definition at line 219 of file bt_peer_connection.cpp.
References libtorrent::peer_connection::allocate_send_buffer(), libtorrent::peer_connection::associated_torrent(), libtorrent::big_number::begin(), libtorrent::buffer::interval::begin, libtorrent::buffer::interval::end, libtorrent::big_number::end(), libtorrent::aux::session_impl::get_peer_id(), INVARIANT_CHECK, libtorrent::peer_connection::m_ses, and libtorrent::peer_connection::setup_send().
Referenced by on_receive().
| void libtorrent::bt_peer_connection::write_extensions | ( | ) |
Definition at line 898 of file bt_peer_connection.cpp.
References libtorrent::peer_connection::allocate_send_buffer(), libtorrent::buffer::interval::begin, libtorrent::bencode(), libtorrent::entry::dictionary_t, libtorrent::buffer::interval::end, INVARIANT_CHECK, libtorrent::peer_connection::is_local(), libtorrent::aux::session_impl::listen_port(), libtorrent::peer_connection::m_extensions, libtorrent::peer_connection::m_ses, m_supports_extensions, libtorrent::session_settings::max_allowed_in_request_queue, msg_extended, libtorrent::entry::print(), libtorrent::peer_connection::remote(), libtorrent::aux::session_impl::settings(), libtorrent::peer_connection::setup_send(), libtorrent::session_settings::user_agent, libtorrent::detail::write_address(), libtorrent::detail::write_int32(), and libtorrent::detail::write_uint8().
Referenced by on_receive().
| void libtorrent::bt_peer_connection::write_chat_message | ( | const std::string & | msg | ) |
| void libtorrent::bt_peer_connection::write_metadata | ( | std::pair< int, int > | req | ) |
| void libtorrent::bt_peer_connection::write_metadata_request | ( | std::pair< int, int > | req | ) |
| void libtorrent::bt_peer_connection::write_keepalive | ( | ) | [virtual] |
Implements libtorrent::peer_connection.
Definition at line 800 of file bt_peer_connection.cpp.
References INVARIANT_CHECK, and libtorrent::peer_connection::send_buffer().
| void libtorrent::bt_peer_connection::write_dht_port | ( | int | listen_port | ) |
Definition at line 136 of file bt_peer_connection.cpp.
References libtorrent::peer_connection::allocate_send_buffer(), libtorrent::buffer::interval::begin, libtorrent::buffer::interval::end, INVARIANT_CHECK, msg_dht_port, libtorrent::peer_connection::setup_send(), libtorrent::detail::write_uint16(), libtorrent::detail::write_uint32(), and libtorrent::detail::write_uint8().
Referenced by on_receive().
| void libtorrent::bt_peer_connection::on_connected | ( | ) | [inline, virtual] |
| void libtorrent::bt_peer_connection::on_metadata | ( | ) | [virtual] |
Reimplemented from libtorrent::peer_connection.
Definition at line 129 of file bt_peer_connection.cpp.
References libtorrent::peer_connection::associated_torrent(), and write_bitfield().
| void libtorrent::bt_peer_connection::check_invariant | ( | ) | const |
Reimplemented from libtorrent::peer_connection.
Definition at line 1394 of file bt_peer_connection.cpp.
References libtorrent::check_invariant(), m_in_constructor, and m_payloads.
| bool libtorrent::bt_peer_connection::dispatch_message | ( | int | received | ) | [private] |
Definition at line 760 of file bt_peer_connection.cpp.
References libtorrent::peer_connection::associated_torrent(), libtorrent::buffer::const_interval::begin, libtorrent::buffer::const_interval::end, INVARIANT_CHECK, asio::placeholders::iterator, libtorrent::peer_connection::m_extensions, m_message_handler, num_supported_messages, libtorrent::peer_connection::packet_finished(), libtorrent::peer_connection::packet_size(), and libtorrent::peer_connection::receive_buffer().
Referenced by on_receive().
| boost::optional< piece_block_progress > libtorrent::bt_peer_connection::downloading_piece_progress | ( | ) | const [private, virtual] |
Reimplemented from libtorrent::peer_connection.
Definition at line 278 of file bt_peer_connection.cpp.
References libtorrent::peer_connection::associated_torrent(), libtorrent::buffer::const_interval::begin, libtorrent::buffer::const_interval::left(), libtorrent::peer_request::length, m_state, msg_piece, libtorrent::peer_connection::packet_size(), libtorrent::peer_request::piece, libtorrent::detail::read_int32(), read_packet, libtorrent::peer_connection::receive_buffer(), libtorrent::peer_request::start, and libtorrent::peer_connection::verify_piece().
Referenced by get_peer_info().
| static bool libtorrent::bt_peer_connection::range_below_zero | ( | const range & | r | ) | [inline, static, private] |
Definition at line 252 of file bt_peer_connection.hpp.
References libtorrent::bt_peer_connection::range::start.
Referenced by on_sent().
friend class invariant_access [friend] |
Reimplemented from libtorrent::peer_connection.
Definition at line 85 of file bt_peer_connection.hpp.
| boost::posix_time::ptime libtorrent::bt_peer_connection::m_last_choke |
Reimplemented from libtorrent::peer_connection.
Definition at line 202 of file bt_peer_connection.hpp.
std::string libtorrent::bt_peer_connection::m_client_version [private] |
Definition at line 226 of file bt_peer_connection.hpp.
Referenced by get_peer_info(), on_extended_handshake(), and on_receive().
state libtorrent::bt_peer_connection::m_state [private] |
Definition at line 228 of file bt_peer_connection.hpp.
Referenced by downloading_piece_progress(), get_peer_info(), in_handshake(), and on_receive().
int libtorrent::bt_peer_connection::m_timeout [private] |
Reimplemented from libtorrent::peer_connection.
Definition at line 231 of file bt_peer_connection.hpp.
const bt_peer_connection::message_handler libtorrent::bt_peer_connection::m_message_handler [static, private] |
Initial value:
{
&bt_peer_connection::on_choke,
&bt_peer_connection::on_unchoke,
&bt_peer_connection::on_interested,
&bt_peer_connection::on_not_interested,
&bt_peer_connection::on_have,
&bt_peer_connection::on_bitfield,
&bt_peer_connection::on_request,
&bt_peer_connection::on_piece,
&bt_peer_connection::on_cancel,
&bt_peer_connection::on_dht_port,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
&bt_peer_connection::on_extended
}
Definition at line 233 of file bt_peer_connection.hpp.
Referenced by dispatch_message().
std::deque<range> libtorrent::bt_peer_connection::m_payloads [private] |
Definition at line 254 of file bt_peer_connection.hpp.
Referenced by check_invariant(), on_sent(), and write_piece().
Definition at line 260 of file bt_peer_connection.hpp.
Referenced by on_receive(), and write_extensions().
Reimplemented from libtorrent::peer_connection.
Definition at line 269 of file bt_peer_connection.hpp.
Referenced by bt_peer_connection(), and check_invariant().
1.5.6