diff --git a/docs/index.html b/docs/index.html index 1282287d7..5607e5273 100644 --- a/docs/index.html +++ b/docs/index.html @@ -32,7 +32,7 @@
-
  • torrent_status
  • -
  • peer_info
  • -
  • session customization
  • @@ -1091,7 +1095,7 @@ bool listen_on(

    is_listening() will tell you whether or not the session has successfully opened a listening port. If it hasn't, this function will return false, and -then you can use listen_on() to make another try.

    +then you can use listen_on() to make another attempt.

    listen_port() returns the port we ended up listening on. Since you just pass a port-range to the constructor and to listen_on(), to know which port it ended up using, you have to ask the session using this function.

    @@ -1103,9 +1107,15 @@ the range and so on. The interface parameter can be left as 0, in that case the os will decide which interface to listen on, otherwise it should be the ip-address of the interface you want the listener socket bound to. listen_on() returns true if it managed to open the socket, and false if it failed. If it fails, it will also -generate an appropriate alert (listen_failed_alert).

    +generate an appropriate alert (listen_failed_alert). If all ports in the specified +range fails to be opened for listening, libtorrent will try to use port 0 (which +tells the operating system to pick a port that's free). If that still fails you +may see a listen_failed_alert with port 0 even if you didn't ask to listen on it.

    The interface parameter can also be a hostname that will resolve to the device you -want to listen on.

    +want to listen on. If you don't specify an interface, libtorrent may attempt to +listen on multiple interfaces (typically 0.0.0.0 and ::). This means that if your +IPv6 interface doesn't work, you may still see a listen_failed_alert, even though +the IPv4 port succeeded.

    If you're also starting the DHT, it is a good idea to do that after you've called listen_on(), since the default listen port for the DHT is the same as the tcp listen socket. If you start the DHT first, it will assume the tcp port is free and @@ -2066,6 +2076,8 @@ struct torrent_handle void clear_error() const; void set_upload_mode(bool m) const; + void flush_cache() const; + void resolve_countries(bool r); bool resolve_countries() const; @@ -2476,6 +2488,20 @@ is not running because the session is paused, this still returns false. To know torrent is active or not, you need to inspect both torrent_handle::is_paused() and session::is_paused().

    +
    +

    flush_cache()

    +
    +
    +void flush_cache() const;
    +
    +
    +

    Instructs libtorrent to flush all the disk caches for this torrent and close all +file handles. This is done asynchronously and you will be notified that it's complete +through cache_flushed_alert.

    +

    Note that by the time you get the alert, libtorrent may have cached more data for the +torrent, but you are guaranteed that whatever cached data libtorrent had by the time +you called torrent_handle::flush_cache() has been written to disk.

    +

    force_recheck()

    @@ -2596,6 +2622,9 @@ replace it. If you want an immediate effect, you have to call

    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.

    +

    The updated set of trackers will be saved in the resume data, and when a torrent +is started with resume data, the trackers from the resume data will replace the +original ones.

    add_url_seed() remove_url_seed() url_seeds()

    @@ -4621,6 +4650,12 @@ pieces are completed. Alerts when some limit is reached that might limit the download or upload rate. +stats_notification +If you enable these alerts, you will receive a stats_alert +approximately once every second, for every active torrent. +These alerts contain all statistics counters for the interval since +the lasts stats alert. + all_categories The full bitmask, representing all available categories. @@ -4759,6 +4794,10 @@ struct external_ip_alert: alert session can be opened for listening. The endpoint member is the interface and port that failed, error is the error code describing the failure.

    +

    libtorrent may sometimes try to listen on port 0, if all other ports failed. +Port 0 asks the operating system to pick a port that's free). If that fails +you may see a listen_failed_alert with port 0 even if you didn't ask to +listen on it.

     struct listen_failed_alert: alert
     {
    @@ -5365,6 +5404,52 @@ struct save_resume_data_failed_alert: torrent_alert
     };
     
    +
    +

    stats_alert

    +

    This alert is posted approximately once every second, and it contains +byte counters of most statistics that's tracked for torrents. Each active +torrent posts these alerts regularly.

    +
    +struct stats_alert: torrent_alert
    +{
    +        // ...
    +        enum stats_channel
    +        {
    +                upload_payload,
    +                upload_protocol,
    +                upload_ip_protocol,
    +                upload_dht_protocol,
    +                upload_tracker_protocol,
    +                download_payload,
    +                download_protocol,
    +                download_ip_protocol,
    +                download_dht_protocol,
    +                download_tracker_protocol,
    +                num_channels
    +        };
    +
    +        int transferred[num_channels];
    +        int interval;
    +};
    +
    +

    transferred this is an array of samples. The enum describes what each +sample is a measurement of. All of these are raw, and not smoothing is performed.

    +

    interval the number of milliseconds during which these stats +were collected. This is typically just above 1000, but if CPU is +limited, it may be higher than that.

    +
    +
    +

    cache_flushed_alert

    +

    This alert is posted when the disk cache has been flushed for a specific torrent +as a result of a call to flush_cache(). This alert belongs to the +storage_notification category, which must be enabled to let this alert through.

    +
    +struct flush_cached_alert: torrent_alert
    +{
    +        // ...
    +};
    +
    +

    dht_announce_alert

    This alert is generated when a DHT node announces to an info-hash on our DHT node. It belongs @@ -6238,6 +6323,7 @@ struct storage_interface virtual bool rename_file(int file, std::string const& new_name) = 0; virtual bool release_files() = 0; virtual bool delete_files() = 0; + virtual void finalize_file(int index) {} virtual ~storage_interface() {} // non virtual functions @@ -6438,6 +6524,20 @@ struct disk_buffer_pool : boost::noncopyable };

    +
    +

    finalize_file()

    +
    +
    +virtual void finalize_file(int index);
    +
    +
    +

    This function is called each time a file is completely downloaded. The +storage implementation can perform last operations on a file. The file will +not be opened for writing after this.

    +

    index is the index of the file that completed.

    +

    On windows the default storage implementation clears the sparse file flag +on the specified file.

    +
    -leechcraft.png +leechcraft.png

    LeechCraft

    -

    LeechCraft LeechCraft is a free open source cross-platform extensible +

    LeechCraft LeechCraft is a free open source cross-platform extensible software, which primary goal is support of file sharing networks and protocols like HTTP and FTP