The pace and scale of my branch of science have become turbocharged. Unlike before when scientific data were hard to get, expensive, and prized, my students and I now freely post or download enormous volumes at little or no cost. We ingest streaming torrents of satellite images and climate model simulations in near-real time; we post our own online for free use by unseen others around the planet. In a data-rich world, a new aesthetic of sharing, transparency, and collaboration has emerged to supplant the old one of data-hoarding and secretiveness. Earth science has become an extraordinarily exciting, vibrant and fast-advancing field because of this.
A torrent in share mode sets the priority to all pieces to 0,except for the pieces that are downloaded, when pieces are decidedto be downloaded. This affects the progress bar, which might be setto "100% finished" most of the time. Do not change file or piecepriorities for torrents in share mode, it will make it not work.
Note that the torrent may transition into a downloading state whilesetting this flag, and since the logic is edge triggered you maymiss the edge. To avoid this race, if the torrent already is in adownloading state when this call is made, it will trigger thestop-when-ready immediately.
These hooks are called when a piece passes the hash check or fails the hashcheck, respectively. The index is the piece index that was downloaded.It is possible to access the list of peers that participated in sending thepiece through the torrent and the piece_picker.
A thin wrapper around a void pointer used as "user data". i.e. an opaquecookie passed in to libtorrent and returned on demand. It adds type-safety byrequiring the same type be requested out of it as was assigned to it.
If you only specify the info-hash, the torrent file will be downloadedfrom peers, which requires them to support the metadata extension. Forthe metadata extension to work, libtorrent must be built with extensionsenabled (TORRENT_DISABLE_EXTENSIONS must not be defined). It alsotakes an optional name argument. This may be left empty in case noname should be assigned to the torrent. In case it's not, the name isused for the torrent as long as it doesn't have metadata. Seetorrent_handle::name.
if dont_count_slow_torrents is true, torrents without anypayload transfers are not subject to the active_seeds andactive_downloads limits. This is intended to make it morelikely to utilize all available bandwidth, and avoid havingtorrents that don't transfer anything block the active slots.
close_redundant_connections specifies whether libtorrent shouldclose connections where both ends have no utility in keeping theconnection open. For instance if both ends have completed theirdownloads, there's no point in keeping it open.
when set to true, all data downloaded from peers will be assumed tobe correct, and not tested to match the hashes in the torrent thisis only useful for simulation and testing purposes (typicallycombined with disabled_storage)
incoming_starts_queued_torrents. If a torrenthas been paused by the auto managed feature in libtorrent, i.e. thetorrent is paused and auto managed, this feature affects whether ornot it is automatically started on an incoming connection. The mainreason to queue torrents, is not to make them unavailable, but tosave on the overhead of announcing to the trackers, the DHT and toavoid spreading one's unchoke slots too thin. If a peer managed tofind us, even though we're no in the torrent anymore, this settingcan make us start the torrent and serve it.
strict_end_game_mode controls when ablock may be requested twice. If this is true, a block may onlybe requested twice when there's at least one request to every piecethat's left to download in the torrent. This may slow down progresson some pieces sometimes, but it may also avoid downloading a lotof redundant bytes. If this is false, libtorrent attempts touse each peer connection to its max, by always requestingsomething, even if it means requesting something that has beenrequested from another peer already.
if this setting is true, torrents with a very high availability ofpieces (and seeds) are downloaded sequentially. This is moreefficient for the disk I/O. With many seeds, the download order isunlikely to matter anyway
when this is true, create an affinity for downloading 4 MiB extentsof adjacent pieces. This is an attempt to achieve better disk I/Othroughput by downloading larger extents of bytes, for torrents withsmall piece sizes
choking_algorithm specifies which algorithm to use to determinehow many peers to unchoke. The unchoking algorithm fordownloading torrents is always "tit-for-tat", i.e. the peers wedownload the fastest from are unchoked.
seed_choking_algorithm controls the seeding unchoke behavior.i.e. How we select which peers to unchoke for seeding torrents.Since a seeding torrent isn't downloading anything, thetit-for-tat mechanism cannot be used. The available options aredefined in the seed_choking_algorithm_t enum.
for auto managed torrents, these are the limits they are subjectto. If there are too many torrents some of the auto managed oneswill be paused until some slots free up. active_downloads andactive_seeds controls how many active seeding and downloadingtorrents the queuing mechanism allows. The target number of activetorrents is min(active_downloads + active_seeds, active_limit).active_downloads and active_seeds are upper limits on thenumber of downloading torrents and seeding torrents respectively.Setting the value to -1 means unlimited.
For example if there are 10 seeding torrents and 10 downloadingtorrents, and active_downloads is 4 and active_seeds is 4,there will be 4 seeds active and 4 downloading torrents. If thesettings are active_downloads = 2 and active_seeds = 4,then there will be 2 downloading torrents and 4 seeding torrentsactive. Torrents that are not auto managed are not counted againstthese limits.
auto_scrape_interval is the number of seconds between scrapesof queued torrents (auto managed and paused torrents). Auto managedtorrents that are paused, are scraped regularly in order to keeptrack of their downloader/seed ratio. This ratio is used todetermine which torrents to seed and which to pause.
this is the number of seconds a torrent is considered active afterit was started, regardless of upload and download speed. This is sothat newly started torrents are not considered inactive until theyhave a fair chance to start downloading.
share_mode_target specifies the target share ratio for sharemode torrents. If set to 3, we'll try to upload 3times as much as we download. Setting this very high, will make itvery conservative and you might end up not downloading anythingever (and not affecting your share ratio). It does not make anysense to set this any lower than 2. For instance, if only 3 peersneed to download the rarest piece, it's impossible to download asingle piece and upload it more than 3 times. If theshare_mode_target is set to more than 3, nothing is downloaded.
hashing_threads is the number of disk I/O threads to use forpiece hash verification. These threads are in addition to theregular disk I/O threads specified by settings_pack::aio_threads.These threads are only used for full checking of torrents. Thehash checking done while downloading are done by the regular diskI/O threads.The hasher threads do not only compute hashes, but also performthe read from disk. On storage optimal for sequential access,such as hard drives, this setting should be set to 1, which isalso the default.
when a seeding torrent reaches either the share ratio (bytes up /bytes down) or the seed time ratio (seconds as seed / seconds asdownloader) or the seed time limit (seconds as seed) it isconsidered done, and it will leave room for other torrents. Theseare specified as percentages. Torrents that are considered done willstill be allowed to be seeded, they just won't have priority anymore.For more, see queuing.
this setting controls the priority of downloading torrents overseeding or finished torrents when it comes to making peerconnections. Peer connections are throttled by the connection_speedand the half-open connection limit. This makes peer connections alimited resource. Torrents that still have pieces to download areprioritized by default, to avoid having many seeding torrents usemost of the connection attempts and only give one peer every nowand then to the downloading torrent. libtorrent will loop over thedownloading torrents to connect a peer each, and every n:thconnection attempt, a finished torrent is picked to be allowed toconnect to a peer. This setting controls n.
the download and upload rate limits for a torrent to be consideredactive by the queuing mechanism. A torrent whose download rate isless than inactive_down_rate and whose upload rate is less thaninactive_up_rate for auto_manage_startup seconds, isconsidered inactive, and another queued torrent may be started.This logic is disabled if dont_count_slow_torrents is false.
The maximum request range of an url seed in bytes. This valuedefines the largest possible sequential web seed request. Lower valuesare possible but will be ignored if they are lower then piece size.This value should be related to your download speed to preventlibtorrent from creating too many expensive http requests persecond. You can select a value as high as you want but keep in mindthat libtorrent can't create parallel requests if the first requestdid already select the whole file.If you combine bittorrent seeds with web seeds and pick strategieslike rarest first you may find your web seed requests split intosmaller parts because we don't download already picked piecestwice.
min_memory_usage returns settings that will use the minimal amount ofRAM, at the potential expense of upload and download performance. Itadjusts the socket buffer sizes, disables the disk cache, lowers the sendbuffer watermarks so that each connection only has at most one block inuse at any one time. It lowers the outstanding blocks send to the diskI/O thread so that connections only have one block waiting to be flushedto disk at any given time. It lowers the max number of peers in the peerlist for torrents. It performs multiple smaller reads when it hashespieces, instead of reading it all into memory before hashing. 2b1af7f3a8