diff --git a/docs/index.html b/docs/index.html index fb046cee7..b1000a5a0 100755 --- a/docs/index.html +++ b/docs/index.html @@ -24,36 +24,36 @@

Contents

-

introduction

+

introduction

libtorrent is a C++ library that aims to be a good alternative to all the other bittorrent implementations around. It is a library and not a full featured client, although it comes with a working @@ -79,18 +79,18 @@ The current state includes the following features:

  • uses separate threads for checking files and for main downloader, with a fool-proof thread-safe library interface. (i.e. There's no way for the user to cause a deadlock).
  • can limit the upload bandwidth usage
  • +
  • piece-wise file allocation
  • Functions that are yet to be implemented:

    libtorrent is portable at least among windows, macosx, and UNIX-systems. It uses boost.thread, @@ -105,7 +105,7 @@ boost.filesystem boost.date_time and various other boost libraries and zlib.

    -

    building

    +

    building

    To build libtorrent you need boost and bjam installed. Then you can use bjam to build libtorrent.

    To make bjam work, you need to set the environment variable BOOST_ROOT to the @@ -136,11 +136,11 @@ loop scope" and "treat wchar_t as built-in type" to Yes.

    TODO: more detailed build instructions.

    -

    using

    +

    using

    The interface of libtorrent consists of a few classes. The main class is the session, it contains the main loop that serves all torrents.

    -

    session

    +

    session

    The session class has the following synopsis:

     class session: public boost::noncopyable
    @@ -185,7 +185,7 @@ increasing the port number until it succeeds or has failed 9 ports. This wil
     change in the future to give more control of the listen-port.

    -

    parsing torrent files

    +

    parsing torrent files

    The torrent files are bencoded. There are two functions in libtorrent that can encode and decode bencoded data. They are:

    @@ -222,7 +222,7 @@ entry e = bdecode(buf, buf + data_size);
     

    Now we just need to know how to retrieve information from the entry.

    -

    entry

    +

    entry

    The entry class represents one node in a bencoded hierarchy. It works as a variant type, it can be either a list, a dictionary (std::map), an integer or a string. This is its synopsis:

    @@ -292,7 +292,7 @@ if (i != dict.end()) exists.

    -

    torrent_info

    +

    torrent_info

    The torrent_info has the following synopsis:

     class torrent_info
    @@ -379,7 +379,7 @@ object, representing the time when this torrent file was created. If there's no
     in the torrent file, this will return a date of january 1:st 1970.

    -

    torrent_handle

    +

    torrent_handle

    You will usually have to store your torrent handles somewhere, since it's the object through which you retrieve infromation about the torrent and aborts the torrent. Its declaration looks like this:

    @@ -397,7 +397,7 @@ struct torrent_handle perform any operation on it, unless you first assign it a valid handle. If you try to perform any operation they will simply return.

    -

    status()

    +

    status()

    status() will return a structure with information about the status of this torrent. It contains the following fields:

    @@ -464,7 +464,7 @@ the pieces we don't have.

    total_done is the total number of bytes of the file(s) that we have.

    -

    get_download_queue()

    +

    get_download_queue()

    get_download_queue() takes a non-const reference to a vector which it will fill information about pieces that are partially downloaded or not downloaded at all but partially requested. The entry in the vector (partial_piece_info) looks like this:

    @@ -496,7 +496,7 @@ When a piece fails a hash verification, single blocks may be redownloaded to see may pass then.

    -

    get_peer_info()

    +

    get_peer_info()

    get_peer_info() takes a reference to a vector that will be cleared and filled with one entry for each peer connected to this torrent. Each entry contains information about that particular peer. It contains the following information:

    @@ -545,7 +545,7 @@ peer every second. It may be -1 if there's no limit.

    -

    address

    +

    address

    The address class represents a name of a network endpoint (usually referred to as IP-address) and a port number. This is the same thing as a sockaddr_in would contain. Its declaration looks like this:

    @@ -579,7 +579,7 @@ while it does the DNS lookup, it returns a string that points to the address rep

    ip() will return the 32-bit ip-address as an integer. port() returns the port number.

    -

    http_settings

    +

    http_settings

    You have some control over tracker requests through the http_settings object. You create it and fill it with your settings and the use session::set_http_settings() to apply them. You have control over proxy and authorization settings and also the user-agent @@ -609,7 +609,7 @@ uncompressed (given your limit is lower than 2 megs). Default limit is 1 megabyte.

    -

    big_number

    +

    big_number

    Both the peer_id and sha1_hash types are typedefs of the class big_number. It represents 20 bytes of data. Its synopsis follows:

    @@ -630,7 +630,7 @@ public:
     

    The iterators gives you access to individual bytes.

    -

    hasher

    +

    hasher

    This class creates sha1-hashes. Its declaration looks like this:

     class hasher
    @@ -654,9 +654,9 @@ call reset() to reinitialize i
     For more info, see src/sha1.c.

    -

    example usage

    +

    example usage

    -

    dump_torrent

    +

    dump_torrent

    This is an example of a program that will take a torrent-file as a parameter and print information about it to std out:

    @@ -722,7 +722,7 @@ int main(int argc, char* argv[])
     
    -

    simple client

    +

    simple client

    This is a simple client. It doesn't have much output to keep it simple:

     #include <iostream>
    @@ -775,13 +775,15 @@ int main(int argc, char* argv[])
     
    -

    Feedback

    +

    Feedback

    There's a mailing list.

    You can usually find me as hydri in #btports @ irc.freenode.net.

    -

    Aknowledgements

    -

    Written by Arvid Norberg. Copyright (c) 2003 Arvid Norberg

    +

    Aknowledgements

    +

    Written by Arvid Norberg and Daniel Wallin. Copyright (c) 2003

    +

    Project is hosted by sourceforge.

    +

    sf_logo

    diff --git a/docs/index.rst b/docs/index.rst index e7709beb4..c9497a432 100755 --- a/docs/index.rst +++ b/docs/index.rst @@ -40,6 +40,7 @@ The current state includes the following features: * uses separate threads for checking files and for main downloader, with a fool-proof thread-safe library interface. (i.e. There's no way for the user to cause a deadlock). * can limit the upload bandwidth usage + * piece-wise file allocation __ http://home.elp.rr.com/tur/multitracker-spec.txt .. _Azureus: http://azureus.sourceforge.net @@ -47,12 +48,11 @@ __ http://home.elp.rr.com/tur/multitracker-spec.txt Functions that are yet to be implemented: * optimistic unchoke + * choke/unchoke algorithm * Snubbing - * end game mode - * new allocation model * fast resume * file-level piece priority - * a good upload speed cap + * a good upload speed cap (the one currently used don't balance loads between peers) libtorrent is portable at least among windows, macosx, and UNIX-systems. It uses boost.thread, boost.filesystem boost.date_time and various other boost libraries and zlib. @@ -849,6 +849,13 @@ You can usually find me as hydri in ``#btports @ irc.freenode.net``. Aknowledgements =============== -Written by Arvid Norberg. Copyright (c) 2003 Arvid Norberg +Written by Arvid Norberg and Daniel Wallin. Copyright (c) 2003 + +Project is hosted by sourceforge. + +|sf_logo|__ + +.. |sf_logo| image:: http://sourceforge.net/sflogo.php?group_id=7994 +__ http://sourceforge.net