|
| Peer (mse::EncryptedPacketSocket::Ptr sock, const PeerID &peer_id, Uint32 num_chunks, Uint32 chunk_size, Uint32 support, bool local, ConnectionLimit::Token::Ptr token, PeerManager *pman) |
|
bt::Uint32 | averageDownloadSpeed () const override |
|
Uint32 | bytesAvailable () const |
| Get the number of bytes available to read.
|
|
void | choke () |
| Choke the peer.
|
|
void | chunkAllowed (Uint32 chunk) override |
| Peer is allowed to download chunk (used for superseeding)
|
|
void | clearPendingPieceUploads () |
|
void | closeConnection () |
|
void | emitMetadataDownloaded (const QByteArray &data) |
|
void | emitPex (const QByteArray &data) |
|
void | emitPortPacket () |
|
net::Address | getAddress () const |
| Get the address of the peer.
|
|
const QTime & | getConnectTime () const |
| Get the time the peer connection was established.
|
|
Uint32 | getDownloadRate () const |
| Get the download rate in bytes per sec.
|
|
Uint32 | getID () const |
| Get the peer's unique ID.
|
|
QString | getIPAddresss () const |
| Get the IP address of the Peer.
|
|
PeerDownloader * | getPeerDownloader () const |
| Get the PeerDownloader.
|
|
PeerManager * | getPeerManager () |
| Get the PeerManager.
|
|
PeerUploader * | getPeerUploader () const |
| Get the PeerUploader.
|
|
Uint16 | getPort () const |
| Get the port of the Peer.
|
|
Uint32 | getTimeSinceLastPiece () const |
| Get the time in milliseconds since the last time a piece was received.
|
|
Uint32 | getUploadRate () const |
| Get the upload rate in bytes per sec.
|
|
void | handlePacket (const bt::Uint8 *packet, bt::Uint32 size) override |
| Handle a received packet.
|
|
bool | hasWantedChunks (const BitSet &wanted_chunks) const |
| Check if the peer has wanted chunks.
|
|
bool | isSnubbed () const |
| Are we being snubbed by the Peer.
|
|
bool | isStalled () const |
| See if the peer is stalled.
|
|
void | kill () override |
|
void | pause () |
| Pause the peer connection.
|
|
float | percentAvailable () const |
|
Uint32 | readData (Uint8 *buf, Uint32 len) |
|
void | sendAllowedFast (Uint32 index) |
|
void | sendBitSet (const BitSet &bs) |
|
void | sendCancel (const Request &r) |
|
void | sendChoke () |
|
bool | sendChunk (Uint32 index, Uint32 begin, Uint32 len, Chunk *ch) |
|
Uint32 | sendData (const Uint8 *data, Uint32 len) |
|
void | sendEvilUnchoke () |
|
void | sendExtProtHandshake (Uint16 port, Uint32 metadata_size, bool partial_seed) |
| Send an extended protocol handshake.
|
|
void | sendExtProtMsg (Uint8 id, const QByteArray &data) |
| Send an extended protocol message.
|
|
void | sendHave (Uint32 index) |
|
void | sendHaveAll () |
| Send a have all message.
|
|
void | sendHaveNone () |
| Send a have none message.
|
|
void | sendInterested () |
|
void | sendNotInterested () |
|
void | sendPort (Uint16 port) |
|
void | sendReject (const Request &r) |
|
void | sendRequest (const Request &r) |
|
void | sendSuggestPiece (Uint32 index) |
|
void | sendUnchoke () |
|
void | setACAScore (double s) |
| Set the ACA score.
|
|
void | setGroupIDs (Uint32 up_gid, Uint32 down_gid) |
|
void | setPexEnabled (bool on) |
| Disable or enable pex.
|
|
void | unpause () |
| Unpause the peer connection.
|
|
void | update () |
| Update the up- and down- speed and handle incoming packets.
|
|
| PeerInterface (const PeerID &peer_id, Uint32 num_chunks) |
|
bool | areWeChoked () const |
| Are we choked for the Peer.
|
|
bool | areWeInterested () const |
| Are we interested in the Peer.
|
|
const BitSet & | getBitSet () const |
| Get the Peer's BitSet.
|
|
TimeStamp | getChokeTime () const |
| Get the time when this Peer choked us.
|
|
const PeerID & | getPeerID () const |
| Get the Peer's ID.
|
|
const Stats & | getStats () const |
| Get the Peer's statistics.
|
|
TimeStamp | getUnchokeTime () const |
| Get the time when this Peer unchoked us.
|
|
bool | isChoked () const |
| Is the Peer choked.
|
|
bool | isDHTSupported () const |
| See if the peer supports DHT.
|
|
bool | isInterested () const |
| Is the Peer interested.
|
|
bool | isKilled () const |
| See if the peer has been killed.
|
|
bool | isSeeder () const |
| See if the peer is a seeder.
|
|
- Author
- Joris Guisson This class manages a connection with a peer in the P2P network. It provides functions for sending packets. Packets it receives get relayed to the outside world using a bunch of signals.
Definition at line 58 of file peer.h.