From bbb551eb8ea93f53073c8c9822e0f5df8bec035d Mon Sep 17 00:00:00 2001
From: Arvid Norberg start extensions (see add_extension()). start DHT, LSD, UPnP, NAT-PMP etc (see start_dht() stop_dht() set_dht_settings() dht_state()
+ start DHT, LSD, UPnP, NAT-PMP etc (see start_dht() stop_dht() set_dht_settings() dht_state() is_dht_running()
start_lsd() stop_lsd(), start_upnp() stop_upnp() and start_natpmp() stop_natpmp()) parse .torrent-files and add them to the session (see bdecode() bencode() and add_torrent())
i2p_proxy returns the current i2p proxy in use.
-void start_dht(entry const& startup_state); void stop_dht(); void set_dht_settings(dht_settings const& settings); entry dht_state() const; +bool is_dht_running() const;
These functions are not available in case TORRENT_DISABLE_DHT is @@ -1304,6 +1306,8 @@ before it is removed from the routing table. If there are known working nodes 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 replace them.
+is_dht_running returns true if the DHT support has been started and false +otherwise.
Note that if you read multiple pieces, the read operations are not guaranteed to finish in the same order as you initiated them.
void force_reannounce() const; void force_reannounce(boost::posix_time::time_duration) const; +void force_dht_announce() const;
force_reannounce() will force this torrent to do another tracker request, to receive new peers. The second overload of force_reannounce that takes a time_duration as argument will schedule a reannounce in that amount of time from now.
+force_dht_announce will announce the torrent to the DHT immediately.
-std::vector<announce_entry> const& trackers() const; +std::vector<announce_entry> trackers() const; void replace_trackers(std::vector<announce_entry> const&) const; void add_tracker(announc_entry const& url);@@ -2522,7 +2529,7 @@ which this tracker is tried. If you want libtorrent to use another list of trackers for this torrent, you can use replace_trackers() which takes a list of the same form as the one returned from trackers() and will replace it. If you want an immediate effect, you have to call -force_reannounce(). +force_reannounce() force_dht_announce(). See trackers() for the definition of announce_entry.add_tracker() will look if the specified tracker is already in the set. If it is, it doesn't do anything. If it's not in the current set of trackers, it will insert it in the tier specified in the announce_entry.
@@ -2592,7 +2599,7 @@ void set_priority(int prio) const; how much bandwidth its peers are assigned when distributing upload and download rate quotas. A high number gives more bandwidth. The priority must be within the range [0, 255].The default priority is 0, which is the lowest priority.
-To query the priority of a torrent, use the `status()`_ call.
+To query the priority of a torrent, use the torrent_handle::status() call.
Torrents with higher priority will not nececcarily get as much bandwidth as they can consume, even if there's is more quota. Other peers will still be weighed in when bandwidth is being distributed. With other words, bandwidth is not distributed strictly @@ -4591,12 +4598,34 @@ public: virtual ~alert(); + virtual int type() const = 0; virtual std::string message() const = 0; virtual char const* what() const = 0; virtual int category() const = 0; virtual std::auto_ptr<alert> clone() const = 0; }; +
type() returns an integer that is unique to this alert type. It can be +compared against a specific alert by querying a static constant called alert_type +in the alert. It can be used to determine the run-time type of an alert* in +order to cast to that alert type and access specific members.
+e.g:
++std::auto_ptr<alert> a = ses.pop_alert(); +switch (a->type()) +{ + case read_piece_alert::alert_type: + { + read_piece_alert* p = (read_piece_alert*)a.get(); + // use p + break; + } + case file_renamed_alert::alert_type: + { + // etc... + } +} +what() returns a string literal describing the type of the alert. It does not include any information that might be bundled with the alert.
category() returns a bitmask specifying which categories this alert belong to.
@@ -4694,7 +4723,7 @@ appears there is no NAT router that can be remote controlled to add port mappings.mapping refers to the mapping index of the port map that failed, i.e. the index returned from add_mapping.
-type is 0 for NAT-PMP and 1 for UPnP.
+map_type is 0 for NAT-PMP and 1 for UPnP.
error tells you what failed.
struct portmap_error_alert: alert @@ -4722,7 +4751,7 @@ struct portmap_alert: alert // ... int mapping; int external_port; - int type; + int map_type; };
for example. For more information, see the Boost.Filesystem docs.
-