From a2b758a20cc2302ced2100fe44b1a04a7ba07a8f Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Sun, 18 Apr 2004 13:58:34 +0000 Subject: [PATCH] *** empty log message *** --- docs/manual.html | 216 ++++++++++++++++++++++++++++++----------------- 1 file changed, 138 insertions(+), 78 deletions(-) diff --git a/docs/manual.html b/docs/manual.html index 2035976d4..59fda6317 100755 --- a/docs/manual.html +++ b/docs/manual.html @@ -13,100 +13,101 @@

Contents

@@ -321,6 +322,8 @@ class session: public boost::noncopyable void set_upload_rate_limit(int bytes_per_second); void set_download_rate_limit(int bytes_per_second); + session_status status() const; + bool is_listening() const; unsigned short listen_port() const; bool listen_on( @@ -410,6 +413,46 @@ you don't want to limit upload rate, you can set this to -1 (the default). set_download_rate_limit() works the same way but for download rate instead of upload rate.

+
+

status()

+
+
+session_status status() const;
+
+
+

status() returns session wide statistics and status. The session_status +struct has the following members:

+
+struct session_status
+{
+        bool has_incoming_connections;
+
+        float upload_rate;
+        float download_rate;
+
+        float payload_upload_rate;
+        float payload_download_rate;
+
+        size_type total_download;
+        size_type total_upload;
+
+        size_type total_payload_download;
+        size_type total_payload_upload;
+
+        int num_peers;
+};
+
+

has_incoming_connections is false as long as no incoming connections has been +established on the listening socket. Every time you change the listen port, this will +be reset to false.

+

upload_rate, download_rate, payload_download_rate and payload_upload_rate +are the total download and upload rates accumulated from all torrents. The payload +versions is the payload download only.

+

total_download and total_upload are the total number of bytes downloaded and +uploaded to and from all torrents. total_payload_download and total_payload_upload +are the same thing but where only the payload is considered.

+

num_peers is the total number of peer connections this session have.

+

is_listening() listen_port() listen_on()

@@ -899,9 +942,12 @@ entry write_resume_data();

write_resume_data() generates fast-resume data and returns it as an entry. This entry is suitable for being bencoded. For more information about how fast-resume works, see fast resume. It may throw invalid_handle if the torrent handle is invalid.

+

Note that by the time this function returns, the resume data may already be invalid if the torrent +is still downloading! The recommended practice is to first pause the torrent, then generate the +fast resume data, and then close it down.

-
-

status()

+
+

status()

 torrent_status status();
@@ -1015,9 +1061,14 @@ struct torrent_status
         size_type total_payload_download;
         size_type total_payload_upload;
 
+        size_type total_failed_bytes;
+
         float download_rate;
         float upload_rate;
 
+        float download_payload_rate;
+        float upload_payload_rate;
+
         int num_peers;
 
         const std::vector<bool>* pieces;
@@ -1069,14 +1120,23 @@ uploaded to all peers, accumulated, this session only.

total_payload_download and total_payload_upload counts the amount of bytes send and received this session, but only the actual oayload data (i.e the interesting data), these counters ignore any protocol overhead.

+

total_failed_bytes is the number of bytes that has been downloaded and that +has failed the piece hash test. In other words, this is just how much crap that +has been downloaded.

pieces is the bitmask that represents which pieces we have (set to true) and the pieces we don't have. It's a pointer and may be set to 0 if the torrent isn't downloading or seeding.

download_rate and upload_rate are the total rates for all peers for this torrent. These will usually have better precision than summing the rates from -all peers. The rates are given as the number of bytes per second.

+all peers. The rates are given as the number of bytes per second. The +download_payload_rate and upload_payload_rate respectively is the +total transfer rate of payload only, not counting protocol chatter. This might +be slightly smaller than the other rates, but if projected over a long time +(e.g. when calculating ETA:s) the difference may be noticable.

num_peers is the number of peers this torrent currently is connected to.

-

total_done is the total number of bytes of the file(s) that we have.

+

total_done is the total number of bytes of the file(s) that we have. All +this does not necessarily has to be downloaded during this session (that's +total_download_payload).