libtorrent
An efficient feature complete C++ bittorrent implementation
...The main class is the session, it contains the main loop that serves all torrents. Each class and function is described in this manual, you may want to have a look at the tutorial as well. If a torrent hits a disk write error, it will be put into upload mode. This means it will not download anything, but only upload. The assumption is that the write error is caused by a full disk or write permission errors. If the torrent is auto-managed, it will periodically be taken out of the upload mode, trying to write things to the disk again.