This section describes the functions and classes that are used to create torrent files. It is a layered API with low level classes and higher level convenience functions. A torrent is created in 4 steps:
1. first the files that will be part of the torrent are determined.
2. the torrent properties are set, such as tracker url, web seeds, DHT nodes etc.
3. Read through all the files in the torrent, SHA-1 all the data and set the piece hashes.
4. The torrent is bencoded into a file or buffer.
If there are a lot of files and or deep directoy hierarchies to traverse, step one can be time consuming.
Typically step 3 is by far the most time consuming step, since it requires to read all the bytes from all the files in the torrent.
All of these classes and functions are declared by including libtorrent/create_torrent.hpp.
Bookmarks