diff --git a/docs/features.html b/docs/features.html index d153b5f61..c5fea58fc 100644 --- a/docs/features.html +++ b/docs/features.html @@ -56,9 +56,11 @@
The root hash is built by hashing all the piece hashes pair-wise, until they all collapse +down to the root.
+ +libtorrent's storage implementation is customizable. That means a special purpose bittorrent +client can replace the default way to store files on disk.
+When implementing a bittorrent cache, it doesn't matter how the data is stored on disk, as +long as it can be retrieved and seeded. In that case a new storage class can be implemented +(inheriting from the storage_interface class) that avoids the unnecessary step of mapping +slots to files and offsets. The storage can ignore the file boundaries and just store the +entire torrent in a single file (which will end up being all the files concatenated). The main +advantage of this, other than a slight cpu performance gain, is that all file operations would +be page (and sector) aligned. This enables efficient unbuffered I/O, and can potentially +lead to more efficient read caching (using the built in disk cache rather than relying on the +operating system's disk cache).
+The storage interface supports operating systems where you can ask for sparse regions +(such as Windows and Solaris). The advantage of this is that when checking files, the regions +that are known to be sparse can be skipped, which can reduce the time to check a torrent +significantly.
+One of the design goals of the libtorrent API is to make common operations simple, but still +have it possible to do complicated and advanced operations. This is best illustrated by example +code to implement a simple bittorrent client:
++#include <iostream> +#include "libtorrent/session.hpp" + +// usage a.out [torrent-file] +int main(int argc, char* argv[]) try +{ + using namespace libtorrent; + + session s; + s.listen_on(std::make_pair(6881, 6889)); + add_torrent_params p; + p.save_path = "./"; + p.ti = new torrent_info(argv[1]); + s.add_torrent(p); + + // wait for the user to end + char a; + std::cin.unsetf(std::ios_base::skipws); + std::cin >> a; + return 0; +} +catch (std::exception& e) +{ + std::cerr << ec.what() << std::endl; + return 1; +} ++
This client doesn't give the user any status information or progress about the torrent, but +it is fully functional.
+libtorrent also comes with python bindings for easy access for python developers.