Class which downloads pieces from a Peer.
More...
#include <peerdownloader.h>
- Author
- Joris Guisson
This class downloads Piece's from a Peer.
Definition at line 101 of file peerdownloader.h.
◆ PeerDownloader()
bt::PeerDownloader::PeerDownloader |
( |
Peer * |
peer, |
|
|
Uint32 |
chunk_size |
|
) |
| |
Constructor, set the Peer
- Parameters
-
peer | The Peer |
chunk_size | Size of a chunk in bytes |
◆ cancel
void bt::PeerDownloader::cancel |
( |
const Request & |
req | ) |
|
|
overrideslot |
◆ cancelAll
void bt::PeerDownloader::cancelAll |
( |
| ) |
|
|
overrideslot |
◆ canDownloadChunk()
bool bt::PeerDownloader::canDownloadChunk |
( |
| ) |
const |
|
overridevirtual |
◆ checkTimeouts()
void bt::PeerDownloader::checkTimeouts |
( |
| ) |
|
|
overridevirtual |
◆ choked()
void bt::PeerDownloader::choked |
( |
| ) |
|
The peer has been choked, all pending requests are rejected. (except for allowed fast ones)
◆ download
void bt::PeerDownloader::download |
( |
const Request & |
req | ) |
|
|
overrideslot |
Send a Request. Note that the DownloadCap may not allow this. (In which case it will be stored temporarely in the unsent_reqs list)
- Parameters
-
◆ getDownloadRate()
Uint32 bt::PeerDownloader::getDownloadRate |
( |
| ) |
const |
|
overridevirtual |
Get the current download rate.
- Returns
- The download rate in bytes/sec
Implements bt::PieceDownloader.
◆ getName()
QString bt::PeerDownloader::getName |
( |
| ) |
const |
|
overridevirtual |
◆ hasChunk()
bool bt::PeerDownloader::hasChunk |
( |
Uint32 |
idx | ) |
const |
|
overridevirtual |
◆ onRejected
void bt::PeerDownloader::onRejected |
( |
const Request & |
req | ) |
|
|
slot |
Handles a rejected request.
- Parameters
-
◆ piece()
void bt::PeerDownloader::piece |
( |
const Piece & |
p | ) |
|
Called when a piece has arrived.
- Parameters
-
◆ update
void bt::PeerDownloader::update |
( |
| ) |
|
|
slot |
Send requests and manage wait queue
The documentation for this class was generated from the following file: