add add_dht_router to libtorrent bindings

This commit is contained in:
Marcos Pinto 2008-01-29 07:16:20 +00:00
parent f757593146
commit c97175a51e
2 changed files with 14 additions and 0 deletions

View File

@ -96,6 +96,8 @@ char const* session_stop_dht_doc =
"";
char const* session_dht_state_doc =
"";
char const* session_add_dht_router_doc =
"add dht router";
char const* session_add_torrent_doc =
"Adds a new torrent to the session. Return a `torrent_handle`.\n"

View File

@ -35,6 +35,7 @@ extern char const* session_status_m_doc;
extern char const* session_start_dht_doc;
extern char const* session_stop_dht_doc;
extern char const* session_dht_state_doc;
extern char const* session_add_dht_router_doc;
extern char const* session_add_torrent_doc;
extern char const* session_remove_torrent_doc;
extern char const* session_set_download_rate_limit_doc;
@ -66,6 +67,12 @@ namespace
return s.listen_on(std::make_pair(min_, max_), interface);
}
void add_dht_router(session& s, std::string router_, int port_)
{
allow_threading_guard guard;
return s.add_dht_router(std::make_pair(router_, port_));
}
struct invoke_extension_factory
{
invoke_extension_factory(object const& callback)
@ -176,6 +183,11 @@ void bind_session()
, (arg("min"), "max", arg("interface") = (char const*)0)
, session_listen_on_doc
)
.def(
"add_dht_router", &add_dht_router
, (arg("router"), "port")
, session_add_dht_router_doc
)
.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)