kget
bt::UDPTrackerSocket Class Reference
#include <udptrackersocket.h>
Detailed Description
Class which handles communication with one or more UDP trackers.
Definition at line 46 of file udptrackersocket.h.
Public Types | |
| enum | Action { CONNECT = 0, ANNOUNCE = 1, SCRAPE = 2, ERROR = 3 } |
Signals | |
| void | announceReceived (Int32 tid, const QByteArray &buf) |
| void | connectReceived (Int32 tid, Int64 connection_id) |
| void | error (Int32 tid, const QString &error_string) |
Public Member Functions | |
| void | cancelTransaction (Int32 tid) |
| Int32 | newTransactionID () |
| void | sendAnnounce (Int32 tid, const Uint8 *data, const KNetwork::KSocketAddress &addr) |
| void | sendConnect (Int32 tid, const KNetwork::KSocketAddress &addr) |
| UDPTrackerSocket () | |
| virtual | ~UDPTrackerSocket () |
Static Public Member Functions | |
| static Uint16 | getPort () |
| static void | setPort (Uint16 p) |
Member Enumeration Documentation
Constructor & Destructor Documentation
| bt::UDPTrackerSocket::UDPTrackerSocket | ( | ) |
Definition at line 46 of file udptrackersocket.cpp.
| bt::UDPTrackerSocket::~UDPTrackerSocket | ( | ) | [virtual] |
Definition at line 76 of file udptrackersocket.cpp.
Member Function Documentation
| void bt::UDPTrackerSocket::announceReceived | ( | Int32 | tid, | |
| const QByteArray & | buf | |||
| ) | [signal] |
Emitted when an announce message is received.
- Parameters:
-
tid The transaction_id buf The data
| void bt::UDPTrackerSocket::cancelTransaction | ( | Int32 | tid | ) |
If a transaction times out, this should be used to cancel it.
- Parameters:
-
tid
Definition at line 101 of file udptrackersocket.cpp.
Emitted when a connect message is received.
- Parameters:
-
tid The transaction_id connection_id The connection_id returned
Signal emitted, when an error occurs during a transaction.
- Parameters:
-
tid The transaction_id error_string Potential error string
| Uint16 bt::UDPTrackerSocket::getPort | ( | ) | [static] |
| Int32 bt::UDPTrackerSocket::newTransactionID | ( | ) |
Compute a free transaction_id.
- Returns:
- A free transaction_id
Definition at line 201 of file udptrackersocket.cpp.
| void bt::UDPTrackerSocket::sendAnnounce | ( | Int32 | tid, | |
| const Uint8 * | data, | |||
| const KNetwork::KSocketAddress & | addr | |||
| ) |
Send an announce message.
As a response to this, the announceReceived signal will be emitted, classes recieving this signal should check if the transaction_id is the same.
- Parameters:
-
tid The transaction_id data The data to send (connect input structure, in UDP Tracker specifaction) addr The address to send to
Definition at line 94 of file udptrackersocket.cpp.
| void bt::UDPTrackerSocket::sendConnect | ( | Int32 | tid, | |
| const KNetwork::KSocketAddress & | addr | |||
| ) |
Send a connect message.
As a response to this, the connectReceived signal will be emitted, classes recieving this signal should check if the transaction_id is the same.
- Parameters:
-
tid The transaction_id addr The address to send to
Definition at line 81 of file udptrackersocket.cpp.
| void bt::UDPTrackerSocket::setPort | ( | Uint16 | p | ) | [static] |
The documentation for this class was generated from the following files:
KDE 4.2 API Reference