LibTorrent is a BitTorrent library written in C++ for Unix. LibTorrent library is designed to avoid the redundant buffers and data copying that most (all?) other BitTorrent implementations suffer from.
The library is single-threaded and the client handles the select loop. An interactive ncurses client is included as an example.
Here are some key features of "LibTorrent":
· The client has full control over the polling of sockets.
· Sigc++ signals makes i easy for the client to react to events.
· Fast resume which checks the file modification time.
Direct reading and writing from network to mmap'ed files:
· Avoids duplication of data where both the application and the kernel has a copy of the file chunk.
· Unused chunks get thrown out or written to disk instead of the swap.
· Kernel handles caching of the file.
File hash check:
· Uses the same thread.
· Client can control the rate. (Will be improved)
· Non-blocking and preload to memory with the mincore and madvise system calls.
· Fine-grained use of file read/write permissions, allows seeding of read-only files.
· Allows torrents with unlimited number of files.
· Opens closed files when mapping chunks to memory, with graceful error handling.
· Support for files larger than 2 GB.
· Different download priorities for files in the torrent.
· Multi-tracker support.
· No dependency on any specific HTTP library, the client implements a wrapper class.
· Dynamic request pipe size.
· Upload and download throttle.
· And much more i haven't bothered mentioning. (nor implementing)
· libsigc++ 2.0
What's New in This Release:
· This release adds support for DHT and cleans up the API.
What's New in This Release: [ read full changelog ]
· Added a simple scheduler framework.Don't send numwant in STOPPED messages as some trackers are stupid about it.Reintroduced clearing of epoll event list when a socket is closed asit might cause race conditions.Added cppUnit test framework. Tests will be added on rather unregular basis.Logging for SCGI calls.Fixed handling of errors when writing out session torrents, itshould no longer hit an infinite loop.Fixed a bug that would cause reading of a piece to hang rtorrent ifthe incoming data contains only data up to a file boundary, but notthe next file's data.Fixes a file handle leak in the execute_capture functions. Patch byJosef Drexler.Fixed crash on empty bitfield in 'd.bitfield'.Fixed the Object::flag_unordered code to handle initial zero-lengthkeys. Ticket #1950.Made torrent::Rate::rate_type uint64_t and added sanity checks dueto reports of bad download/upload values being reported to sometrackers.