#include <peersource.h>
- Author
- Joris Guisson joris.nosp@m..gui.nosp@m.sson@.nosp@m.gmai.nosp@m.l.com
This class is the base class for all classes who which to provide potential peers for torrents. PeerSources should work independently and should emit a signal when they have peers ready.
Definition at line 41 of file peersource.h.
◆ aboutToBeDestroyed
virtual void bt::PeerSource::aboutToBeDestroyed |
( |
| ) |
|
|
virtualslot |
The source is about to be destroyed. Subclasses can override this to clean up some things.
◆ addPeer()
void bt::PeerSource::addPeer |
( |
const net::Address & |
addr, |
|
|
bool |
local = false |
|
) |
| |
Add a peer to the list of peers.
- Parameters
-
addr | The address of the peer |
port | The port |
local | Whether or not the peer is on the local network |
◆ completed
virtual void bt::PeerSource::completed |
( |
| ) |
|
|
virtualslot |
The torrent has finished downloading. This is optional and should be used by HTTP and UDP tracker sources to notify the tracker.
Reimplemented in bt::UDPTracker, and bt::HTTPTracker.
◆ manualUpdate
virtual void bt::PeerSource::manualUpdate |
( |
| ) |
|
|
virtualslot |
PeerSources wanting to implement a manual update, should implement this.
Reimplemented in dht::DHTPeerSource.
◆ peersReady
void bt::PeerSource::peersReady |
( |
PeerSource * |
ps | ) |
|
|
signal |
This signal should be emitted when a new batch of peers is ready.
- Parameters
-
◆ start
virtual void bt::PeerSource::start |
( |
| ) |
|
|
pure virtualslot |
◆ stop
virtual void bt::PeerSource::stop |
( |
bt::WaitJob * |
wjob = 0 | ) |
|
|
pure virtualslot |
◆ takePeer()
bool bt::PeerSource::takePeer |
( |
net::Address & |
addr, |
|
|
bool & |
local |
|
) |
| |
Take the first peer from the list. The item is removed from the list.
- Parameters
-
addr | The address of the peer |
local | Is this is a peer on the local network |
- Returns
- true If there was one available, false if not
The documentation for this class was generated from the following file: