libktorrent  2.2.0
Public Member Functions | List of all members
bt::UDPTracker Class Reference

Communicates with an UDP tracker. More...

#include <udptracker.h>

Inheritance diagram for bt::UDPTracker:
Inheritance graph
[legend]

Public Member Functions

 UDPTracker (const QUrl &url, TrackerDataSource *tds, const PeerID &id, int tier)
 
void completed () override
 
Uint32 failureCount () const override
 
void scrape () override
 
void start () override
 
void stop (WaitJob *wjob=0) override
 
- Public Member Functions inherited from bt::Tracker
 Tracker (const QUrl &url, TrackerDataSource *tds, const PeerID &id, int tier)
 
int getTier () const
 Get the trackers tier.
 
void handleFailure ()
 Handle a failure.
 
void timedDelete (int ms)
 
QUrl trackerURL () const
 get the tracker url
 
- Public Member Functions inherited from bt::PeerSource
void addPeer (const net::Address &addr, bool local=false)
 
bool takePeer (net::Address &addr, bool &local)
 
- Public Member Functions inherited from bt::TrackerInterface
 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 hasWarning () const
 Is there any warnings.
 
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.
 
bool timeOut () const
 Is tracker timed out.
 
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
 

Additional Inherited Members

- Public Slots inherited from bt::Tracker
void manualUpdate () override=0
 
- Public Slots inherited from bt::PeerSource
virtual void aboutToBeDestroyed ()
 
virtual void manualUpdate ()
 
- Signals inherited from bt::Tracker
void requestFailed (const QString &failure_reason)
 
void requestOK ()
 
void requestPending ()
 
void scrapeDone ()
 
void stopDone ()
 
- Signals inherited from bt::PeerSource
void peersReady (PeerSource *ps)
 
- Static Public Member Functions inherited from bt::Tracker
static QString getCustomIP ()
 Get the custom ip to use, null if none is set.
 
static void setCustomIP (const QString &str)
 
- Protected Member Functions inherited from bt::Tracker
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 inherited from bt::Tracker
Uint64 bytes_downloaded_at_start
 
Uint64 bytes_uploaded_at_start
 
Uint32 key
 
PeerID peer_id
 
QTimer reannounce_timer
 
TrackerDataSourcetds
 
int tier
 
- Protected Attributes inherited from bt::TrackerInterface
bool enabled
 
QString error
 
Uint32 interval
 
int leechers
 
QDateTime request_time
 
int seeders
 
bool started
 
TrackerStatus status
 
bool time_out
 
int total_downloaded
 
QUrl url
 
QString warning
 

Detailed Description

Author
Joris Guisson

This class is able to communicate with an UDP tracker. This is an implementation of the protocol described in http://xbtt.sourceforge.net/udp_tracker_protocol.html

Definition at line 47 of file udptracker.h.

Member Function Documentation

◆ completed()

void bt::UDPTracker::completed ( )
overridevirtual

The torrent has finished downloading. This is optional and should be used by HTTP and UDP tracker sources to notify the tracker.

Reimplemented from bt::PeerSource.

◆ failureCount()

Uint32 bt::UDPTracker::failureCount ( ) const
inlineoverridevirtual

Get the number of failed attempts to reach a tracker.

Returns
The number of failed attempts

Implements bt::Tracker.

Definition at line 57 of file udptracker.h.

◆ scrape()

void bt::UDPTracker::scrape ( )
overridevirtual

Do a tracker scrape to get more accurate stats about a torrent. Does nothing if the tracker does not support this.

Implements bt::Tracker.

◆ start()

void bt::UDPTracker::start ( )
overridevirtual

Start gathering peers.

Implements bt::PeerSource.

◆ stop()

void bt::UDPTracker::stop ( WaitJob wjob = 0)
overridevirtual

Stop gathering peers.

Implements bt::PeerSource.


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