Add setting outgoing_ports in libtorrent

This commit is contained in:
Andrew Resch 2008-07-30 05:29:57 +00:00
parent dd4fc26877
commit e93e1391a4
1 changed files with 9 additions and 1 deletions

View File

@ -68,7 +68,14 @@ namespace
allow_threading_guard guard;
return s.listen_on(std::make_pair(min_, max_), interface);
}
void outgoing_ports(session& s, int _min, int _max)
{
allow_threading_guard guard;
session_settings settings = s.settings();
settings.outgoing_ports = std::make_pair(_min, _max);
s.set_settings(settings);
return;
}
#ifndef TORRENT_DISABLE_DHT
void add_dht_router(session& s, std::string router_, int port_)
{
@ -257,6 +264,7 @@ void bind_session()
, (arg("min"), "max", arg("interface") = (char const*)0)
, session_listen_on_doc
)
.def("outgoing_ports", &outgoing_ports)
.def("is_listening", allow_threads(&session::is_listening), session_is_listening_doc)
.def("listen_port", allow_threads(&session::listen_port), session_listen_port_doc)
.def("status", allow_threads(&session::status), session_status_m_doc)