libktorrent
2.1.1
|
#include <tracker.h>
Public Slots | |
void | manualUpdate () override=0 |
![]() | |
virtual void | aboutToBeDestroyed () |
virtual void | completed () |
virtual void | manualUpdate () |
virtual void | start ()=0 |
virtual void | stop (bt::WaitJob *wjob=0)=0 |
Signals | |
void | requestFailed (const QString &failure_reason) |
void | requestOK () |
void | requestPending () |
void | scrapeDone () |
void | stopDone () |
![]() | |
void | peersReady (PeerSource *ps) |
Public Member Functions | |
Tracker (const QUrl &url, TrackerDataSource *tds, const PeerID &id, int tier) | |
virtual Uint32 | failureCount () const =0 |
int | getTier () const |
Get the trackers tier. | |
void | handleFailure () |
Handle a failure. | |
virtual void | scrape ()=0 |
void | timedDelete (int ms) |
QUrl | trackerURL () const |
get the tracker url | |
![]() | |
void | addPeer (const net::Address &addr, bool local=false) |
bool | takePeer (net::Address &addr, bool &local) |
![]() | |
TrackerInterface (const QUrl &url) | |
Uint32 | getInterval () const |
int | getNumLeechers () const |
Get the number of leechers. | |
int | getNumSeeders () const |
Get the number of seeders. | |
int | getTotalTimesDownloaded () const |
Get the number of times the torrent was downloaded. | |
bool | isEnabled () const |
Is the tracker enabled. | |
bool | isStarted () const |
See if a start request succeeded. | |
virtual void | reset () |
Reset the tracker. | |
void | setEnabled (bool on) |
Enable or disable the tracker. | |
void | setInterval (Uint32 i) |
Set the interval. | |
Uint32 | timeToNextUpdate () const |
Get the time in seconds to the next tracker update. | |
TrackerStatus | trackerStatus () const |
Get the tracker status. | |
QString | trackerStatusString () const |
Get a string of the current tracker status. | |
QUrl | trackerURL () const |
get the tracker url | |
Static Public Member Functions | |
static QString | getCustomIP () |
Get the custom ip to use, null if none is set. | |
static void | setCustomIP (const QString &str) |
Protected Member Functions | |
Uint64 | bytesDownloaded () const |
Calculates the bytes downloaded to send with the request. | |
Uint64 | bytesUploaded () const |
Calculates the bytes uploaded to send with the request. | |
void | failed (const QString &err) |
Emit the failure signal, and set the error. | |
void | resetTrackerStats () |
Reset the tracker stats. | |
Protected Attributes | |
Uint64 | bytes_downloaded_at_start |
Uint64 | bytes_uploaded_at_start |
Uint32 | key |
PeerID | peer_id |
QTimer | reannounce_timer |
TrackerDataSource * | tds |
int | tier |
![]() | |
bool | enabled |
QString | error |
Uint32 | interval |
int | leechers |
QDateTime | request_time |
int | seeders |
bool | started |
TrackerStatus | status |
int | total_downloaded |
QUrl | url |
QString | warning |
|
pure virtual |
Get the number of failed attempts to reach a tracker.
Implemented in bt::UDPTracker, and bt::HTTPTracker.
|
signal |
Emitted when an error happens.
failure_reason | The reason why we couldn't reach the tracker |
|
signal |
Emitted when a request to the tracker succeeded
|
signal |
A request to the tracker has been started.
|
pure virtual |
Do a tracker scrape to get more accurate stats about a torrent. Does nothing if the tracker does not support this.
Implemented in bt::UDPTracker, and bt::HTTPTracker.
|
signal |
Emitted when a scrape has finished
|
static |
Set the custom IP
str |
|
signal |
Emitted when a stop is done.
void bt::Tracker::timedDelete | ( | int | ms | ) |
Delete the tracker in ms milliseconds, or when the stopDone signal is emitted.
ms | Number of ms to wait |