improve peer class documentation

This commit is contained in:
arvidn 2017-11-24 09:25:57 +01:00 committed by Arvid Norberg
parent cfd50ae736
commit 4e452c7bb6
3 changed files with 13 additions and 5 deletions

View File

@ -845,6 +845,12 @@ The default peer class IDs are defined as enums in the ``session`` class:
local_peer_class_id
};
The default peer classes are automatically created on session startup, and
configured to apply to each respective type of connection. There's nothing
preventing a client from reconfiguring the peer class ip- and type filters
to disable or customize which peers they apply to. See set_peer_class_filter()
and set_peer_class_type_filter().
A peer class can be considered a more general form of *lables* that some
clients have. Peer classes however are not just applied to torrents, but
ultimately the peers.
@ -854,9 +860,9 @@ object), and deleted with the delete_peer_class() call.
Peer classes are configured with the set_peer_class() get_peer_class() calls.
Custom peer classes can be assigned to torrents, with the ??? call, in which
case all its peers will belong to the class. They can also be assigned based on
the peer's IP address. See set_peer_class_filter() for more information.
Custom peer classes can be assigned based on the peer's IP address or the type
of transport protocol used. See set_peer_class_filter() and
set_peer_class_type_filter() for more information.
peer class examples
-------------------

View File

@ -49,7 +49,9 @@ namespace libtorrent
{
typedef boost::uint32_t peer_class_t;
struct peer_class_info
// holds settings for a peer class. Used in set_peer_class() and
// get_peer_class() calls.
struct TORRENT_EXPORT peer_class_info
{
// ``ignore_unchoke_slots`` determines whether peers should always
// unchoke a peer, regardless of the choking algorithm, or if it should

View File

@ -708,7 +708,7 @@ namespace libtorrent
// return value of ``get_peer_class()`` is undefined.
//
// ``set_peer_class()`` sets all the information in the
// ``peer_class_info`` object in the specified peer class. There is no
// peer_class_info object in the specified peer class. There is no
// option to only update a single property.
//
// A peer or torrent belonging to more than one class, the highest