libtorrent
Description: A feature complete BitTorrent protocol implementation as a C++ library

Version: | 2.0.8

home

Table of contents

- announce_infohash
- announce_endpoint
- announce_entry
  - ~announce_entry() operator=() announce_entry()
  - enum tracker_source

[report issue]

# announce_infohash

Declared in "libtorrent/announce_entry.hpp"

    struct announce_infohash
    {
       std::string message;
       error_code last_error;
       int scrape_incomplete  = -1;
       int scrape_complete  = -1;
       int scrape_downloaded  = -1;
       std::uint8_t fails : 7;
       bool updating : 1;
       bool start_sent : 1;
       bool complete_sent : 1;
    };

[report issue]

message
  if this tracker has returned an error or warning message that message is stored here

[report issue]

last_error
  if this tracker failed the last time it was contacted this error code specifies what error occurred

[report issue]

scrape_incomplete scrape_complete scrape_downloaded
  if this tracker has returned scrape data, these fields are filled in with valid numbers. Otherwise they are set to -1. `incomplete` counts the number of current downloaders. `complete` counts the number of current peers completed the download, or "seeds". `downloaded` is the cumulative number of completed downloads.

[report issue]

fails
  the number of times in a row we have failed to announce to this tracker.

[report issue]

updating
  true while we're waiting for a response from the tracker.

[report issue]

start_sent
  set to true when we get a valid response from an announce with event=started. If it is set, we won't send start in the subsequent announces.

[report issue]

complete_sent
  set to true when we send a event=completed.

[report issue]

# announce_endpoint

Declared in "libtorrent/announce_entry.hpp"

announces are sent to each tracker using every listen socket this class holds information about one listen socket for one tracker

    struct announce_endpoint
    {
       announce_endpoint ();

       tcp::endpoint local_endpoint;
       aux::array<announce_infohash, num_protocols, protocol_version> info_hashes;
       bool enabled  = true;
    };

[report issue]

local_endpoint
  the local endpoint of the listen interface associated with this endpoint

[report issue]

info_hashes
  info_hashes[0] is the v1 info hash (SHA1) info_hashes[1] is the v2 info hash (truncated SHA-256)

[report issue]

enabled
  set to false to not announce from this endpoint

[report issue]

# announce_entry

Declared in "libtorrent/announce_entry.hpp"

this class holds information about one bittorrent tracker, as it relates to a specific torrent.

    struct announce_entry
    {
       explicit announce_entry (string_view u);
       announce_entry& operator= (announce_entry const&) &;
       announce_entry (announce_entry const&);
       ~announce_entry ();
       announce_entry ();

       enum tracker_source
       {
          source_torrent,
          source_client,
          source_magnet_link,
          source_tex,
       };

       std::string url;
       std::string trackerid;
       std::vector<announce_endpoint> endpoints;
       std::uint8_t tier  = 0;
       std::uint8_t fail_limit  = 0;
       std::uint8_t source:4;
       bool verified:1;
    };

[report issue]

## ~announce_entry() operator=() announce_entry()

    explicit announce_entry (string_view u);
    announce_entry& operator= (announce_entry const&) &;
    announce_entry (announce_entry const&);
    ~announce_entry ();
    announce_entry ();

constructs a tracker announce entry with `u` as the URL.

[report issue]

## enum tracker_source

Declared in "libtorrent/announce_entry.hpp"

name | value | description
--- | --- | ---
source_torrent | 1 | the tracker was part of the .torrent file
source_client | 2 | the tracker was added programmatically via the add_tracker() function
source_magnet_link | 4 | the tracker was part of a magnet link
source_tex | 8 | the tracker was received from the swarm via tracker exchange

[report issue]

url
  tracker URL as it appeared in the torrent file

[report issue]

trackerid
  the current `&trackerid=` argument passed to the tracker. this is optional and is normally empty (in which case no trackerid is sent).

[report issue]

endpoints
  each local listen socket (endpoint) will announce to the tracker. This list contains state per endpoint.

[report issue]

tier
  the tier this tracker belongs to

[report issue]

fail_limit
  the max number of failures to announce to this tracker in a row, before this tracker is not used anymore. 0 means unlimited

[report issue]

source
  a bitmask specifying which sources we got this tracker from.

[report issue]

verified
  set to true the first time we receive a valid response from this tracker.