• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdenetwork
  • Sitemap
  • Contact Us
 

kget

bt::UDPTrackerSocket

bt::UDPTrackerSocket Class Reference

#include <udptrackersocket.h>

Inheritance diagram for bt::UDPTrackerSocket:

Inheritance graph
[legend]

List of all members.


Detailed Description

Author:
Joris Guisson

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

enum bt::UDPTrackerSocket::Action

Enumerator:
CONNECT 
ANNOUNCE 
SCRAPE 
ERROR 

Definition at line 53 of file udptrackersocket.h.


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.

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

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

Uint16 bt::UDPTrackerSocket::getPort (  )  [static]

Get the port in use.

Definition at line 214 of file udptrackersocket.cpp.

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]

Set the port ot use.

Parameters:
p The port

Definition at line 209 of file udptrackersocket.cpp.


The documentation for this class was generated from the following files:
  • udptrackersocket.h
  • udptrackersocket.cpp

kget

Skip menu "kget"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdenetwork

Skip menu "kdenetwork"
  • kget
  • kopete
  •   kopete
  •   libkopete
  •       libpapillon
  • krfb
Generated for kdenetwork by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal