libktorrent
2.2.0
|
#include <peerinterface.h>
Classes | |
struct | Stats |
Public Member Functions | |
PeerInterface (const PeerID &peer_id, Uint32 num_chunks) | |
bool | areWeChoked () const |
Are we choked for the Peer. | |
bool | areWeInterested () const |
Are we interested in the Peer. | |
virtual bt::Uint32 | averageDownloadSpeed () const =0 |
virtual void | chunkAllowed (bt::Uint32 chunk)=0 |
Peer is allowed to download chunk (used for superseeding) | |
const BitSet & | getBitSet () const |
Get the Peer's BitSet. | |
TimeStamp | getChokeTime () const |
Get the time when this Peer choked us. | |
const PeerID & | getPeerID () const |
Get the Peer's ID. | |
const Stats & | getStats () const |
Get the Peer's statistics. | |
TimeStamp | getUnchokeTime () const |
Get the time when this Peer unchoked us. | |
virtual void | handlePacket (const bt::Uint8 *packet, bt::Uint32 size)=0 |
Handle a received packet. | |
bool | isChoked () const |
Is the Peer choked. | |
bool | isDHTSupported () const |
See if the peer supports DHT. | |
bool | isInterested () const |
Is the Peer interested. | |
bool | isKilled () const |
See if the peer has been killed. | |
bool | isSeeder () const |
See if the peer is a seeder. | |
virtual void | kill ()=0 |
Protected Attributes | |
bool | killed |
bool | paused |
PeerID | peer_id |
BitSet | pieces |
PeerInterface::Stats | stats |
This is the interface for a Peer, it allows other classes to get statistics about a Peer, and provides some basic functionality provided by a Peer.
Definition at line 39 of file peerinterface.h.
bt::PeerInterface::PeerInterface | ( | const PeerID & | peer_id, |
Uint32 | num_chunks | ||
) |
|
pure virtual |
Get the average download speed since the last unchoke in bytes/sec
Implemented in bt::Peer.
|
pure virtual |
Kill the Peer, will ensure the PeerManager closes the connection, and cleans things up.
Implemented in bt::Peer.