#include <udptrackersocket.h>
|
enum | Action { CONNECT = 0,
ANNOUNCE = 1,
SCRAPE = 2,
ERROR = 3
} |
|
|
static Uint16 | getPort () |
| Get the port in use.
|
|
static void | setPort (Uint16 p) |
|
- Author
- Joris Guisson
Class which handles communication with one or more UDP trackers.
Definition at line 46 of file udptrackersocket.h.
◆ announceReceived
void bt::UDPTrackerSocket::announceReceived |
( |
Int32 |
tid, |
|
|
const Uint8 * |
buf, |
|
|
Uint32 |
size |
|
) |
| |
|
signal |
Emitted when an announce message is received.
- Parameters
-
tid | The transaction_id |
buf | The data |
size | The data size |
◆ cancelTransaction()
void bt::UDPTrackerSocket::cancelTransaction |
( |
Int32 |
tid | ) |
|
If a transaction times out, this should be used to cancel it.
- Parameters
-
◆ connectReceived
void bt::UDPTrackerSocket::connectReceived |
( |
Int32 |
tid, |
|
|
Int64 |
connection_id |
|
) |
| |
|
signal |
Emitted when a connect message is received.
- Parameters
-
tid | The transaction_id |
connection_id | The connection_id returned |
◆ error
void bt::UDPTrackerSocket::error |
( |
Int32 |
tid, |
|
|
const QString & |
error_string |
|
) |
| |
|
signal |
Signal emitted, when an error occurs during a transaction.
- Parameters
-
tid | The transaction_id |
error_string | Potential error string |
◆ newTransactionID()
Int32 bt::UDPTrackerSocket::newTransactionID |
( |
| ) |
|
Compute a free transaction_id.
- Returns
- A free transaction_id
◆ scrapeReceived
void bt::UDPTrackerSocket::scrapeReceived |
( |
Int32 |
tid, |
|
|
const Uint8 * |
buf, |
|
|
Uint32 |
size |
|
) |
| |
|
signal |
Emitted when a scrape message is received.
- Parameters
-
tid | The transaction_id |
buf | The data |
size | The data size |
◆ sendAnnounce()
void bt::UDPTrackerSocket::sendAnnounce |
( |
Int32 |
tid, |
|
|
const Uint8 * |
data, |
|
|
const net::Address & |
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 |
◆ sendConnect()
void bt::UDPTrackerSocket::sendConnect |
( |
Int32 |
tid, |
|
|
const net::Address & |
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 |
◆ sendScrape()
void bt::UDPTrackerSocket::sendScrape |
( |
Int32 |
tid, |
|
|
const Uint8 * |
data, |
|
|
const net::Address & |
addr |
|
) |
| |
Send a scrape message. As a response to this, the scrapeReceived 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 |
◆ setPort()
static void bt::UDPTrackerSocket::setPort |
( |
Uint16 |
p | ) |
|
|
static |
Set the port ot use.
- Parameters
-
The documentation for this class was generated from the following file: