libtorrent::aux::session_impl Struct Reference

#include <session_impl.hpp>

List of all members.

Public Types

typedef std::map
< boost::shared_ptr
< stream_socket >
, boost::intrusive_ptr
< peer_connection > > 
connection_map
typedef std::map< sha1_hash,
boost::shared_ptr< torrent > > 
torrent_map
typedef std::deque
< boost::intrusive_ptr
< peer_connection > > 
connection_queue
typedef boost::recursive_mutex mutex_t
typedef std::list
< boost::function
< boost::shared_ptr
< torrent_plugin >torrent *)> > 
extension_list_t

Public Member Functions

 session_impl (std::pair< int, int > listen_port_range, fingerprint const &cl_fprint, char const *listen_interface="0.0.0.0")
 ~session_impl ()
void add_extension (boost::function< boost::shared_ptr< torrent_plugin >(torrent *)> ext)
void operator() ()
void open_listen_port ()
void async_accept ()
void on_incoming_connection (boost::shared_ptr< stream_socket > const &s, boost::weak_ptr< socket_acceptor > const &as, asio::error_code const &e)
boost::weak_ptr< torrentfind_torrent (const sha1_hash &info_hash)
peer_id const & get_peer_id () const
void process_connection_queue ()
void close_connection (boost::intrusive_ptr< peer_connection > const &p)
void connection_completed (boost::intrusive_ptr< peer_connection > const &p)
void connection_failed (boost::shared_ptr< stream_socket > const &s, tcp::endpoint const &a, char const *message)
void set_settings (session_settings const &s)
session_settings const & settings () const
void add_dht_node (std::pair< std::string, int > const &node)
void add_dht_node (udp::endpoint n)
void add_dht_router (std::pair< std::string, int > const &node)
void set_dht_settings (dht_settings const &s)
dht_settings const & kad_settings () const
void start_dht (entry const &startup_state)
void stop_dht ()
entry dht_state () const
bool is_aborted () const
void set_ip_filter (ip_filter const &f)
bool listen_on (std::pair< int, int > const &port_range, const char *net_interface=0)
bool is_listening () const
torrent_handle add_torrent (torrent_info const &ti, boost::filesystem::path const &save_path, entry const &resume_data, bool compact_mode, int block_size)
torrent_handle add_torrent (char const *tracker_url, sha1_hash const &info_hash, char const *name, boost::filesystem::path const &save_path, entry const &resume_data, bool compact_mode, int block_size)
void remove_torrent (torrent_handle const &h)
std::vector< torrent_handleget_torrents ()
void set_severity_level (alert::severity_t s)
std::auto_ptr< alertpop_alert ()
int upload_rate_limit () const
int download_rate_limit () const
void set_download_rate_limit (int bytes_per_second)
void set_upload_rate_limit (int bytes_per_second)
void set_max_half_open_connections (int limit)
void set_max_connections (int limit)
void set_max_uploads (int limit)
int num_uploads () const
int num_connections () const
session_status status () const
void set_peer_id (peer_id const &id)
void set_key (int key)
unsigned short listen_port () const
void abort ()
torrent_handle find_torrent_handle (sha1_hash const &info_hash)
void second_tick (asio::error_code const &e)
void check_invariant (const char *place=0)

Public Attributes

mutex_t m_mutex
alert_manager m_alerts
io_service m_io_service
asio::strand m_strand
bandwidth_manager m_dl_bandwidth_manager
bandwidth_manager m_ul_bandwidth_manager
tracker_manager m_tracker_manager
torrent_map m_torrents
connection_map m_connections
connection_map m_half_open
connection_queue m_connection_queue
ip_filter m_ip_filter
peer_id m_peer_id
int m_key
std::pair< int, int > m_listen_port_range
tcp::endpoint m_listen_interface
boost::shared_ptr
< socket_acceptor
m_listen_socket
session_settings m_settings
volatile bool m_abort
int m_max_uploads
int m_max_connections
int m_half_open_limit
stat m_stat
bool m_incoming_connection
file_pool m_files
boost::posix_time::ptime m_last_tick
boost::intrusive_ptr
< dht::dht_tracker
m_dht
dht_settings m_dht_settings
deadline_timer m_timer
extension_list_t m_extensions
checker_impl m_checker_impl
boost::scoped_ptr< boost::thread > m_thread
boost::scoped_ptr< boost::thread > m_checker_thread

Friends

class ::libtorrent::peer_connection
struct checker_impl
class invariant_access


Detailed Description

Definition at line 159 of file session_impl.hpp.


Member Typedef Documentation

typedef std::map<boost::shared_ptr<stream_socket> , boost::intrusive_ptr<peer_connection> > libtorrent::aux::session_impl::connection_map

Definition at line 168 of file session_impl.hpp.

typedef std::map<sha1_hash, boost::shared_ptr<torrent> > libtorrent::aux::session_impl::torrent_map

Definition at line 169 of file session_impl.hpp.

typedef std::deque<boost::intrusive_ptr<peer_connection> > libtorrent::aux::session_impl::connection_queue

Definition at line 171 of file session_impl.hpp.

typedef boost::recursive_mutex libtorrent::aux::session_impl::mutex_t

Definition at line 192 of file session_impl.hpp.

typedef std::list<boost::function<boost::shared_ptr< torrent_plugin>torrent*)> > libtorrent::aux::session_impl::extension_list_t

Definition at line 393 of file session_impl.hpp.


Constructor & Destructor Documentation

libtorrent::aux::session_impl::session_impl ( std::pair< int, int >  listen_port_range,
fingerprint const &  cl_fprint,
char const *  listen_interface = "0.0.0.0" 
)

libtorrent::aux::session_impl::~session_impl (  ) 


Member Function Documentation

void libtorrent::aux::session_impl::add_extension ( boost::function< boost::shared_ptr< torrent_plugin >(torrent *)>  ext  ) 

Definition at line 519 of file session_impl.cpp.

References m_extensions.

void libtorrent::aux::session_impl::operator() (  ) 

void libtorrent::aux::session_impl::open_listen_port (  ) 

void libtorrent::aux::session_impl::async_accept (  ) 

void libtorrent::aux::session_impl::on_incoming_connection ( boost::shared_ptr< stream_socket > const &  s,
boost::weak_ptr< socket_acceptor > const &  as,
asio::error_code const &  e 
)

Referenced by async_accept().

boost::weak_ptr< torrent > libtorrent::aux::session_impl::find_torrent ( const sha1_hash info_hash  ) 

peer_id const& libtorrent::aux::session_impl::get_peer_id (  )  const [inline]

void libtorrent::aux::session_impl::process_connection_queue (  ) 

void libtorrent::aux::session_impl::close_connection ( boost::intrusive_ptr< peer_connection > const &  p  ) 

void libtorrent::aux::session_impl::connection_completed ( boost::intrusive_ptr< peer_connection > const &  p  ) 

void libtorrent::aux::session_impl::connection_failed ( boost::shared_ptr< stream_socket > const &  s,
tcp::endpoint const &  a,
char const *  message 
)

void libtorrent::aux::session_impl::set_settings ( session_settings const &  s  ) 

session_settings const& libtorrent::aux::session_impl::settings (  )  const [inline]

void libtorrent::aux::session_impl::add_dht_node ( std::pair< std::string, int > const &  node  ) 

Definition at line 1521 of file session_impl.cpp.

References l, m_dht, and m_mutex.

Referenced by libtorrent::peer_connection::incoming_dht_port().

void libtorrent::aux::session_impl::add_dht_node ( udp::endpoint  n  ) 

Definition at line 527 of file session_impl.cpp.

References m_dht.

void libtorrent::aux::session_impl::add_dht_router ( std::pair< std::string, int > const &  node  ) 

Definition at line 1528 of file session_impl.cpp.

References l, m_dht, and m_mutex.

void libtorrent::aux::session_impl::set_dht_settings ( dht_settings const &  s  ) 

dht_settings const& libtorrent::aux::session_impl::kad_settings (  )  const [inline]

Definition at line 216 of file session_impl.hpp.

References m_dht_settings.

Referenced by libtorrent::bt_peer_connection::on_receive().

void libtorrent::aux::session_impl::start_dht ( entry const &  startup_state  ) 

void libtorrent::aux::session_impl::stop_dht (  ) 

Definition at line 1494 of file session_impl.cpp.

References l, m_dht, and m_mutex.

Referenced by ~session_impl().

entry libtorrent::aux::session_impl::dht_state (  )  const

Definition at line 1514 of file session_impl.cpp.

References l, m_dht, and m_mutex.

bool libtorrent::aux::session_impl::is_aborted (  )  const [inline]

void libtorrent::aux::session_impl::set_ip_filter ( ip_filter const &  f  ) 

bool libtorrent::aux::session_impl::listen_on ( std::pair< int, int > const &  port_range,
const char *  net_interface = 0 
)

bool libtorrent::aux::session_impl::is_listening (  )  const

Definition at line 1545 of file session_impl.cpp.

References l, m_listen_socket, and m_mutex.

torrent_handle libtorrent::aux::session_impl::add_torrent ( torrent_info const &  ti,
boost::filesystem::path const &  save_path,
entry const &  resume_data,
bool  compact_mode,
int  block_size 
)

torrent_handle libtorrent::aux::session_impl::add_torrent ( char const *  tracker_url,
sha1_hash const &  info_hash,
char const *  name,
boost::filesystem::path const &  save_path,
entry const &  resume_data,
bool  compact_mode,
int  block_size 
)

void libtorrent::aux::session_impl::remove_torrent ( torrent_handle const &  h  ) 

std::vector< torrent_handle > libtorrent::aux::session_impl::get_torrents (  ) 

void libtorrent::aux::session_impl::set_severity_level ( alert::severity_t  s  ) 

Definition at line 1646 of file session_impl.cpp.

References l, m_alerts, m_mutex, and libtorrent::alert_manager::set_severity().

std::auto_ptr< alert > libtorrent::aux::session_impl::pop_alert (  ) 

int libtorrent::aux::session_impl::upload_rate_limit (  )  const

int libtorrent::aux::session_impl::download_rate_limit (  )  const

void libtorrent::aux::session_impl::set_download_rate_limit ( int  bytes_per_second  ) 

void libtorrent::aux::session_impl::set_upload_rate_limit ( int  bytes_per_second  ) 

void libtorrent::aux::session_impl::set_max_half_open_connections ( int  limit  ) 

Definition at line 1604 of file session_impl.cpp.

References l, m_half_open_limit, and m_mutex.

void libtorrent::aux::session_impl::set_max_connections ( int  limit  ) 

Definition at line 1597 of file session_impl.cpp.

References l, m_max_connections, and m_mutex.

void libtorrent::aux::session_impl::set_max_uploads ( int  limit  ) 

Definition at line 1590 of file session_impl.cpp.

References l, m_max_uploads, and m_mutex.

int libtorrent::aux::session_impl::num_uploads (  )  const

Definition at line 1620 of file session_impl.cpp.

References l, m_mutex, and m_torrents.

int libtorrent::aux::session_impl::num_connections (  )  const

Definition at line 1632 of file session_impl.cpp.

References l, m_connections, m_half_open, and m_mutex.

session_status libtorrent::aux::session_impl::status (  )  const

void libtorrent::aux::session_impl::set_peer_id ( peer_id const &  id  ) 

Definition at line 853 of file session_impl.cpp.

References l, m_mutex, and m_peer_id.

void libtorrent::aux::session_impl::set_key ( int  key  ) 

Definition at line 859 of file session_impl.cpp.

References l, m_key, and m_mutex.

unsigned short libtorrent::aux::session_impl::listen_port (  )  const

void libtorrent::aux::session_impl::abort (  ) 

torrent_handle libtorrent::aux::session_impl::find_torrent_handle ( sha1_hash const &  info_hash  ) 

Definition at line 1173 of file session_impl.cpp.

References m_checker_impl.

void libtorrent::aux::session_impl::second_tick ( asio::error_code const &  e  ) 

void libtorrent::aux::session_impl::check_invariant ( const char *  place = 0  ) 

Definition at line 1665 of file session_impl.cpp.

References asio::placeholders::iterator, m_connections, and m_half_open.


Friends And Related Function Documentation

friend class ::libtorrent::peer_connection [friend]

Definition at line 162 of file session_impl.hpp.

friend struct checker_impl [friend]

Definition at line 164 of file session_impl.hpp.

friend class invariant_access [friend]

Definition at line 165 of file session_impl.hpp.


Member Data Documentation

Definition at line 193 of file session_impl.hpp.

Referenced by abort(), add_dht_node(), add_dht_router(), add_torrent(), libtorrent::peer_connection::assign_bandwidth(), libtorrent::torrent::assign_bandwidth(), libtorrent::call_member(), libtorrent::catch(), libtorrent::torrent::check_files(), close_connection(), libtorrent::torrent_handle::connect_peer(), connection_completed(), connection_failed(), dht_state(), libtorrent::torrent::disconnect_all(), download_rate_limit(), libtorrent::peer_connection::expire_bandwidth(), libtorrent::torrent::expire_bandwidth(), libtorrent::torrent_handle::file_progress(), libtorrent::torrent::files_checked(), libtorrent::torrent_handle::force_reannounce(), libtorrent::torrent_handle::get_download_queue(), libtorrent::torrent_handle::get_peer_info(), get_torrents(), is_listening(), libtorrent::torrent_handle::is_valid(), listen_on(), listen_port(), num_connections(), num_uploads(), libtorrent::peer_connection::on_connection_complete(), libtorrent::torrent::on_name_lookup(), libtorrent::torrent::on_peer_name_lookup(), libtorrent::torrent::on_proxy_name_lookup(), libtorrent::web_peer_connection::on_receive(), libtorrent::peer_connection::on_receive_data(), libtorrent::peer_connection::on_send_data(), operator()(), libtorrent::aux::checker_impl::operator()(), pop_alert(), remove_torrent(), second_tick(), set_dht_settings(), set_download_rate_limit(), set_ip_filter(), set_key(), set_max_connections(), set_max_half_open_connections(), set_max_uploads(), set_peer_id(), set_settings(), set_severity_level(), set_upload_rate_limit(), libtorrent::peer_connection::setup_receive(), libtorrent::peer_connection::setup_send(), start_dht(), status(), libtorrent::torrent_handle::status(), stop_dht(), libtorrent::torrent::tracker_request_error(), libtorrent::torrent::tracker_request_timed_out(), libtorrent::torrent::tracker_response(), libtorrent::torrent::tracker_warning(), upload_rate_limit(), libtorrent::torrent_handle::write_resume_data(), and ~session_impl().

Definition at line 293 of file session_impl.hpp.

Referenced by operator()(), remove_torrent(), and second_tick().

Definition at line 315 of file session_impl.hpp.

Referenced by get_peer_id(), session_impl(), and set_peer_id().

Definition at line 320 of file session_impl.hpp.

Referenced by operator()(), remove_torrent(), second_tick(), session_impl(), and set_key().

Definition at line 323 of file session_impl.hpp.

Referenced by listen_on(), open_listen_port(), and operator()().

Definition at line 332 of file session_impl.hpp.

Referenced by async_accept(), is_listening(), listen_on(), and open_listen_port().

Definition at line 335 of file session_impl.hpp.

Referenced by operator()(), set_settings(), and settings().

Definition at line 342 of file session_impl.hpp.

Referenced by second_tick(), and set_max_uploads().

Definition at line 343 of file session_impl.hpp.

Referenced by second_tick(), and set_max_connections().

Definition at line 346 of file session_impl.hpp.

Referenced by process_connection_queue(), and set_max_half_open_connections().

Definition at line 349 of file session_impl.hpp.

Referenced by second_tick(), and status().

Definition at line 355 of file session_impl.hpp.

Referenced by listen_on(), and status().

Definition at line 360 of file session_impl.hpp.

Referenced by libtorrent::torrent::init(), and set_settings().

Definition at line 363 of file session_impl.hpp.

Referenced by second_tick().

Definition at line 367 of file session_impl.hpp.

Referenced by kad_settings(), listen_on(), set_dht_settings(), and start_dht().

Definition at line 370 of file session_impl.hpp.

Referenced by second_tick(), and session_impl().

Definition at line 395 of file session_impl.hpp.

Referenced by add_extension(), and add_torrent().

boost::scoped_ptr<boost::thread> libtorrent::aux::session_impl::m_thread

Definition at line 403 of file session_impl.hpp.

Referenced by session_impl(), and ~session_impl().

boost::scoped_ptr<boost::thread> libtorrent::aux::session_impl::m_checker_thread

Definition at line 407 of file session_impl.hpp.

Referenced by session_impl(), and ~session_impl().


The documentation for this struct was generated from the following files:

Generated on Sun May 25 00:21:46 2008 by  doxygen 1.5.6