forked from premiere/premiere-libtorrent
Update and clean-up session.cpp in python bindings
This commit is contained in:
parent
3212c929ac
commit
15f1ec0b0b
|
@ -14,12 +14,12 @@ using namespace libtorrent;
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
|
|
||||||
bool listen_on(session& s, int min_, int max_, char const* interface)
|
bool listen_on(session& s, int min_, int max_, char const* interface)
|
||||||
{
|
{
|
||||||
allow_threading_guard guard;
|
allow_threading_guard guard;
|
||||||
return s.listen_on(std::make_pair(min_, max_), interface);
|
return s.listen_on(std::make_pair(min_, max_), interface);
|
||||||
}
|
}
|
||||||
|
|
||||||
void outgoing_ports(session& s, int _min, int _max)
|
void outgoing_ports(session& s, int _min, int _max)
|
||||||
{
|
{
|
||||||
allow_threading_guard guard;
|
allow_threading_guard guard;
|
||||||
|
@ -155,26 +155,70 @@ namespace
|
||||||
#endif
|
#endif
|
||||||
} // namespace unnamed
|
} // namespace unnamed
|
||||||
|
|
||||||
|
|
||||||
void bind_session()
|
void bind_session()
|
||||||
{
|
{
|
||||||
class_<session_status>("session_status")
|
class_<session_status>("session_status")
|
||||||
.def_readonly("has_incoming_connections", &session_status::has_incoming_connections)
|
.def_readonly("has_incoming_connections", &session_status::has_incoming_connections)
|
||||||
|
|
||||||
.def_readonly("upload_rate", &session_status::upload_rate)
|
.def_readonly("upload_rate", &session_status::upload_rate)
|
||||||
.def_readonly("download_rate", &session_status::download_rate)
|
.def_readonly("download_rate", &session_status::download_rate)
|
||||||
.def_readonly("payload_upload_rate", &session_status::payload_upload_rate)
|
|
||||||
.def_readonly("payload_download_rate", &session_status::payload_download_rate)
|
|
||||||
.def_readonly("total_download", &session_status::total_download)
|
.def_readonly("total_download", &session_status::total_download)
|
||||||
.def_readonly("total_upload", &session_status::total_upload)
|
.def_readonly("total_upload", &session_status::total_upload)
|
||||||
|
|
||||||
|
.def_readonly("payload_upload_rate", &session_status::payload_upload_rate)
|
||||||
|
.def_readonly("payload_download_rate", &session_status::payload_download_rate)
|
||||||
.def_readonly("total_payload_download", &session_status::total_payload_download)
|
.def_readonly("total_payload_download", &session_status::total_payload_download)
|
||||||
.def_readonly("total_payload_upload", &session_status::total_payload_upload)
|
.def_readonly("total_payload_upload", &session_status::total_payload_upload)
|
||||||
|
|
||||||
|
.def_readonly("ip_overhead_upload_rate", &session_status::ip_overhead_upload_rate)
|
||||||
|
.def_readonly("ip_overhead_download_rate", &session_status::ip_overhead_download_rate)
|
||||||
|
.def_readonly("total_ip_overhead_download", &session_status::total_ip_overhead_download)
|
||||||
|
.def_readonly("total_ip_overhead_upload", &session_status::total_ip_overhead_upload)
|
||||||
|
|
||||||
|
.def_readonly("dht_upload_rate", &session_status::dht_upload_rate)
|
||||||
|
.def_readonly("dht_download_rate", &session_status::dht_download_rate)
|
||||||
|
.def_readonly("total_dht_download", &session_status::total_dht_download)
|
||||||
|
.def_readonly("total_dht_upload", &session_status::total_dht_upload)
|
||||||
|
|
||||||
|
.def_readonly("tracker_upload_rate", &session_status::tracker_upload_rate)
|
||||||
|
.def_readonly("tracker_download_rate", &session_status::tracker_download_rate)
|
||||||
|
.def_readonly("total_tracker_download", &session_status::total_tracker_download)
|
||||||
|
.def_readonly("total_tracker_upload", &session_status::total_tracker_upload)
|
||||||
|
|
||||||
|
.def_readonly("total_redundant_bytes", &session_status::total_redundant_bytes)
|
||||||
|
.def_readonly("total_failed_bytes", &session_status::total_failed_bytes)
|
||||||
|
|
||||||
.def_readonly("num_peers", &session_status::num_peers)
|
.def_readonly("num_peers", &session_status::num_peers)
|
||||||
|
.def_readonly("num_unchoked", &session_status::num_unchoked)
|
||||||
|
.def_readonly("allowed_upload_slots", &session_status::allowed_upload_slots)
|
||||||
|
|
||||||
|
.def_readonly("up_bandwidth_queue", &session_status::up_bandwidth_queue)
|
||||||
|
.def_readonly("down_bandwidth_queue", &session_status::down_bandwidth_queue)
|
||||||
|
|
||||||
|
.def_readonly("up_bandwidth_bytes_queue", &session_status::up_bandwidth_bytes_queue)
|
||||||
|
.def_readonly("down_bandwidth_bytes_queue", &session_status::down_bandwidth_bytes_queue)
|
||||||
|
|
||||||
|
.def_readonly("optimistic_unchoke_counter", &session_status::optimistic_unchoke_counter)
|
||||||
|
.def_readonly("unchoke_counter", &session_status::unchoke_counter)
|
||||||
|
|
||||||
#ifndef TORRENT_DISABLE_DHT
|
#ifndef TORRENT_DISABLE_DHT
|
||||||
.def_readonly("dht_nodes", &session_status::dht_nodes)
|
.def_readonly("dht_nodes", &session_status::dht_nodes)
|
||||||
.def_readonly("dht_cache_nodes", &session_status::dht_node_cache)
|
.def_readonly("dht_cache_nodes", &session_status::dht_node_cache)
|
||||||
.def_readonly("dht_torrents", &session_status::dht_torrents)
|
.def_readonly("dht_torrents", &session_status::dht_torrents)
|
||||||
|
.def_readonly("dht_global_nodes", &session_status::dht_global_nodes)
|
||||||
|
.def_readonly("active_requests", &session_status::active_requests)
|
||||||
#endif
|
#endif
|
||||||
;
|
;
|
||||||
|
|
||||||
|
class_<dht_lookup>("dht_lookup")
|
||||||
|
.def_readonly("type", &dht_lookup::type)
|
||||||
|
.def_readonly("outstanding_requests", &dht_lookup::outstanding_requests)
|
||||||
|
.def_readonly("timeouts", &dht_lookup::timeouts)
|
||||||
|
.def_readonly("response", &dht_lookup::responses)
|
||||||
|
.def_readonly("branch_factor", &dht_lookup::branch_factor)
|
||||||
|
;
|
||||||
|
|
||||||
enum_<storage_mode_t>("storage_mode_t")
|
enum_<storage_mode_t>("storage_mode_t")
|
||||||
.value("storage_mode_allocate", storage_mode_allocate)
|
.value("storage_mode_allocate", storage_mode_allocate)
|
||||||
.value("storage_mode_sparse", storage_mode_sparse)
|
.value("storage_mode_sparse", storage_mode_sparse)
|
||||||
|
|
Loading…
Reference in New Issue