kget
bt::PeerManager Class Reference
#include <peermanager.h>

Detailed Description
Manages all the Peers
This class manages all Peer objects. It can also open connections to other peers.
Definition at line 65 of file peermanager.h.
Member Typedef Documentation
| typedef QList<Peer*>::const_iterator bt::PeerManager::CItr |
Definition at line 206 of file peermanager.h.
Constructor & Destructor Documentation
| bt::PeerManager::PeerManager | ( | Torrent & | tor | ) |
| bt::PeerManager::~PeerManager | ( | ) | [virtual] |
Definition at line 66 of file peermanager.cpp.
Member Function Documentation
| void bt::PeerManager::addPotentialPeer | ( | const PotentialPeer & | pp | ) |
Add a potential peer.
- Parameters:
-
pp The PotentialPeer
Definition at line 148 of file peermanager.cpp.
| CItr bt::PeerManager::beginPeerList | ( | ) | const [inline] |
Definition at line 208 of file peermanager.h.
| Uint32 bt::PeerManager::clearDeadPeers | ( | ) |
Remove dead peers.
- Returns:
- The number of dead ones removed
Definition at line 410 of file peermanager.cpp.
| void bt::PeerManager::closeAllConnections | ( | ) |
| bool bt::PeerManager::connectedTo | ( | const PeerID & | peer_id | ) |
| void bt::PeerManager::connectToPeers | ( | ) |
| CItr bt::PeerManager::endPeerList | ( | ) | const [inline] |
Definition at line 209 of file peermanager.h.
| Peer * bt::PeerManager::findPeer | ( | PieceDownloader * | pd | ) |
Find a Peer based on it's PieceDownloader.
- Parameters:
-
pd The PieceDownloader
- Returns:
- The matching Peer or 0 if none can be found
Definition at line 521 of file peermanager.cpp.
Find a Peer based on it's ID.
- Parameters:
-
peer_id The ID
- Returns:
- A Peer or 0, if nothing could be found
Definition at line 516 of file peermanager.cpp.
| const BitSet& bt::PeerManager::getAvailableChunksBitSet | ( | ) | const [inline] |
| ChunkCounter& bt::PeerManager::getChunkCounter | ( | ) | [inline] |
| static Uint32 bt::PeerManager::getMaxConnections | ( | ) | [inline, static] |
Definition at line 140 of file peermanager.h.
| static Uint32 bt::PeerManager::getMaxTotalConnections | ( | ) | [inline, static] |
Definition at line 143 of file peermanager.h.
| Uint32 bt::PeerManager::getNumConnectedPeers | ( | ) | const [inline] |
Definition at line 136 of file peermanager.h.
| Uint32 bt::PeerManager::getNumPending | ( | ) | const [inline] |
Definition at line 137 of file peermanager.h.
Get the i'th Peer.
- Parameters:
-
index
- Returns:
- Peer or 0 if out of range
Definition at line 94 of file peermanager.h.
| Torrent& bt::PeerManager::getTorrent | ( | ) | [inline] |
| static Uint32 bt::PeerManager::getTotalConnections | ( | ) | [inline, static] |
Definition at line 145 of file peermanager.h.
| bool bt::PeerManager::isPexEnabled | ( | ) | const [inline] |
| bool bt::PeerManager::isStarted | ( | ) | const [inline] |
| void bt::PeerManager::killChokedPeers | ( | Uint32 | older_then | ) |
Kill all peers who have been choked longer then older_then time.
- Parameters:
-
older_then Time in milliseconds
Definition at line 113 of file peermanager.cpp.
| void bt::PeerManager::killSeeders | ( | ) |
Kills all connections to seeders.
This is used when torrent download gets finished and we should drop all connections to seeders
Definition at line 197 of file peermanager.cpp.
| void bt::PeerManager::killUninterested | ( | ) |
Kills all peers that are not interested for a long time.
This should be used when torrent is seeding ONLY.
Definition at line 209 of file peermanager.cpp.
| void bt::PeerManager::loadPeerList | ( | const QString & | file | ) |
Load the peer list again and add them to the potential peers.
Definition at line 468 of file peermanager.cpp.
| void bt::PeerManager::newConnection | ( | mse::StreamSocket * | sock, | |
| const PeerID & | peer_id, | |||
| Uint32 | support | |||
| ) |
A new connection is ready for this PeerManager.
- Parameters:
-
sock The socket peer_id The Peer's ID support What extensions the peer supports
Definition at line 240 of file peermanager.cpp.
| void bt::PeerManager::newPeer | ( | Peer * | p | ) | [signal] |
| void bt::PeerManager::peerAuthenticated | ( | Authenticate * | auth, | |
| bool | ok | |||
| ) |
A peer has authenticated.
- Parameters:
-
auth The Authenticate object ok Whether or not the attempt was succesfull
Definition at line 260 of file peermanager.cpp.
| void bt::PeerManager::peerKilled | ( | Peer * | p | ) | [signal] |
| void bt::PeerManager::peerSourceReady | ( | PeerSource * | ps | ) | [slot] |
A PeerSource, has new potential peers.
- Parameters:
-
ps The PeerSource
Definition at line 547 of file peermanager.cpp.
| void bt::PeerManager::savePeerList | ( | const QString & | file | ) |
| void bt::PeerManager::setMaxConnections | ( | Uint32 | max | ) | [static] |
Definition at line 132 of file peermanager.cpp.
| void bt::PeerManager::setMaxTotalConnections | ( | Uint32 | max | ) | [static] |
Definition at line 137 of file peermanager.cpp.
| void bt::PeerManager::setPexEnabled | ( | bool | on | ) |
| void bt::PeerManager::start | ( | ) |
| void bt::PeerManager::stop | ( | ) |
| void bt::PeerManager::stopped | ( | ) | [signal] |
| void bt::PeerManager::update | ( | ) |
Check for new connections, update down and upload speed of each Peer.
Initiate new connections.
Definition at line 80 of file peermanager.cpp.
The documentation for this class was generated from the following files:
KDE 4.2 API Reference