added session::is_dht_running
This commit is contained in:
@@ -73,6 +73,7 @@
|
|||||||
* added ability to give seeding torrents preference to active slots
|
* added ability to give seeding torrents preference to active slots
|
||||||
* added torrent_status::finished_time
|
* added torrent_status::finished_time
|
||||||
* automatically caps files and connections by default to rlimit
|
* automatically caps files and connections by default to rlimit
|
||||||
|
* added session::is_dht_running() function
|
||||||
|
|
||||||
release 0.14.7
|
release 0.14.7
|
||||||
|
|
||||||
|
@@ -213,6 +213,7 @@ The ``session`` class has the following synopsis::
|
|||||||
, int> const& node);
|
, int> const& node);
|
||||||
void add_dht_router(std::pair<std::string
|
void add_dht_router(std::pair<std::string
|
||||||
, int> const& node);
|
, int> const& node);
|
||||||
|
bool is_dht_running() const;
|
||||||
|
|
||||||
void start_lsd();
|
void start_lsd();
|
||||||
void stop_lsd();
|
void stop_lsd();
|
||||||
@@ -1064,8 +1065,8 @@ are ``hostname`` and ``port``.
|
|||||||
.. _i2p: http://www.i2p2.de
|
.. _i2p: http://www.i2p2.de
|
||||||
|
|
||||||
|
|
||||||
start_dht() stop_dht() set_dht_settings() dht_state()
|
start_dht() stop_dht() set_dht_settings() dht_state() is_dht_running()
|
||||||
-----------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
@@ -1073,6 +1074,7 @@ start_dht() stop_dht() set_dht_settings() dht_state()
|
|||||||
void stop_dht();
|
void stop_dht();
|
||||||
void set_dht_settings(dht_settings const& settings);
|
void set_dht_settings(dht_settings const& settings);
|
||||||
entry dht_state() const;
|
entry dht_state() const;
|
||||||
|
bool is_dht_running() const;
|
||||||
|
|
||||||
These functions are not available in case ``TORRENT_DISABLE_DHT`` is
|
These functions are not available in case ``TORRENT_DISABLE_DHT`` is
|
||||||
defined. ``start_dht`` starts the dht node and makes the trackerless service
|
defined. ``start_dht`` starts the dht node and makes the trackerless service
|
||||||
@@ -1133,6 +1135,9 @@ that are ready to replace a failing node, it will be replaced immediately,
|
|||||||
this limit is only used to clear out nodes that don't have any node that can
|
this limit is only used to clear out nodes that don't have any node that can
|
||||||
replace them.
|
replace them.
|
||||||
|
|
||||||
|
``is_dht_running`` returns true if the DHT support has been started and false
|
||||||
|
otherwise.
|
||||||
|
|
||||||
|
|
||||||
add_dht_node() add_dht_router()
|
add_dht_node() add_dht_router()
|
||||||
-------------------------------
|
-------------------------------
|
||||||
|
@@ -285,6 +285,7 @@ namespace libtorrent
|
|||||||
entry dht_state() const;
|
entry dht_state() const;
|
||||||
void add_dht_node(std::pair<std::string, int> const& node);
|
void add_dht_node(std::pair<std::string, int> const& node);
|
||||||
void add_dht_router(std::pair<std::string, int> const& node);
|
void add_dht_router(std::pair<std::string, int> const& node);
|
||||||
|
bool is_dht_running() const;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef TORRENT_DISABLE_ENCRYPTION
|
#ifndef TORRENT_DISABLE_ENCRYPTION
|
||||||
|
@@ -618,6 +618,12 @@ namespace libtorrent
|
|||||||
m_impl->add_dht_router(node);
|
m_impl->add_dht_router(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool session::is_dht_running() const
|
||||||
|
{
|
||||||
|
mutex::scoped_lock l(m_impl->m_mutex);
|
||||||
|
return m_impl->m_dht;
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef TORRENT_DISABLE_ENCRYPTION
|
#ifndef TORRENT_DISABLE_ENCRYPTION
|
||||||
|
Reference in New Issue
Block a user