libktorrent  2.1.1
Public Member Functions | List of all members
bt::PeerUploader Class Reference

Uploads pieces to a Peer. More...

#include <peeruploader.h>

Public Member Functions

 PeerUploader (Peer *peer)
 
void addRequest (const Request &r)
 
void addUploadedBytes (Uint32 bytes)
 
void clearAllRequests ()
 
Uint32 getNumRequests () const
 Get the number of requests.
 
Uint32 handleRequests (bt::ChunkManager &cman)
 
void removeRequest (const Request &r)
 

Detailed Description

Author
Joris Guisson This class handles the uploading of pieces to a Peer. It keeps track of a list of Request objects. All these Requests where sent by the Peer. It will upload the pieces to the Peer, making sure that the maximum upload rate isn't surpassed.

Definition at line 62 of file peeruploader.h.

Constructor & Destructor Documentation

◆ PeerUploader()

bt::PeerUploader::PeerUploader ( Peer peer)

Constructor. Set the Peer.

Parameters
peerThe Peer

Member Function Documentation

◆ addRequest()

void bt::PeerUploader::addRequest ( const Request r)

Add a Request to the list of Requests.

Parameters
rThe Request

◆ clearAllRequests()

void bt::PeerUploader::clearAllRequests ( )

Clear all pending requests.

◆ handleRequests()

Uint32 bt::PeerUploader::handleRequests ( bt::ChunkManager cman)

Update the PeerUploader. This will check if there are Request, and will try to handle them.

Parameters
cmanThe ChunkManager
Returns
The number of bytes uploaded

◆ removeRequest()

void bt::PeerUploader::removeRequest ( const Request r)

Remove a Request from the list of Requests.

Parameters
rThe Request

The documentation for this class was generated from the following file: