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

kget

dht::DHTBase

dht::DHTBase Class Reference

#include <dhtbase.h>

Inheritance diagram for dht::DHTBase:

Inheritance graph
[legend]

List of all members.


Detailed Description

Author:
Joris Guisson <joris.guisson@gmail.com>

Interface for DHT class, this is to keep other things separate from the inner workings of the DHT.

Definition at line 52 of file dhtbase.h.


Signals

void started ()
void stopped ()

Public Member Functions

virtual void addDHTNode (const QString &host, bt::Uint16 hport)=0
virtual AnnounceTask * announce (const bt::SHA1Hash &info_hash, bt::Uint16 port)=0
 DHTBase ()
virtual QMap< QString, int > getClosestGoodNodes (int maxNodes)=0
bt::Uint16 getPort () const
const dht::Stats & getStats () const
bool isRunning () const
virtual void portReceived (const QString &ip, bt::Uint16 port)=0
virtual void start (const QString &table, const QString &key_file, bt::Uint16 port)=0
virtual void stop ()=0
virtual void update ()=0
virtual ~DHTBase ()

Protected Attributes

bt::Uint16 port
bool running
dht::Stats stats

Constructor & Destructor Documentation

dht::DHTBase::DHTBase (  ) 

Definition at line 25 of file dhtbase.cpp.

dht::DHTBase::~DHTBase (  )  [virtual]

Definition at line 32 of file dhtbase.cpp.


Member Function Documentation

virtual void dht::DHTBase::addDHTNode ( const QString &  host,
bt::Uint16  hport 
) [pure virtual]

Add a DHT node.

This node shall be pinged immediately.

Parameters:
host The hostname or ip
hport The port of the host

Implemented in dht::DHT.

virtual AnnounceTask* dht::DHTBase::announce ( const bt::SHA1Hash &  info_hash,
bt::Uint16  port 
) [pure virtual]

Do an announce on the DHT network.

Parameters:
info_hash The info_hash
port The port
Returns:
The task which handles this

Implemented in dht::DHT.

virtual QMap<QString, int> dht::DHTBase::getClosestGoodNodes ( int  maxNodes  )  [pure virtual]

Returns maxNodes number of <IP address, port> nodes that are closest to ourselves and are good.

Parameters:
maxNodes maximum nr of nodes in QMap to return.

Implemented in dht::DHT.

bt::Uint16 dht::DHTBase::getPort (  )  const [inline]

Get the DHT port.

Definition at line 99 of file dhtbase.h.

const dht::Stats& dht::DHTBase::getStats (  )  const [inline]

Get statistics about the DHT.

Definition at line 102 of file dhtbase.h.

bool dht::DHTBase::isRunning (  )  const [inline]

See if the DHT is running.

Definition at line 96 of file dhtbase.h.

virtual void dht::DHTBase::portReceived ( const QString &  ip,
bt::Uint16  port 
) [pure virtual]

A Peer has received a PORT message, and uses this function to alert the DHT of it.

Parameters:
ip The IP of the peer
port The port in the PORT message

Implemented in dht::DHT.

virtual void dht::DHTBase::start ( const QString &  table,
const QString &  key_file,
bt::Uint16  port 
) [pure virtual]

Start the DHT.

Parameters:
table File where the save table is located
key_file Where our DHT key is stored
port The port to use

Implemented in dht::DHT.

void dht::DHTBase::started (  )  [signal]

virtual void dht::DHTBase::stop (  )  [pure virtual]

Stop the DHT.

Implemented in dht::DHT.

void dht::DHTBase::stopped (  )  [signal]

virtual void dht::DHTBase::update (  )  [pure virtual]

Update the DHT.


Member Data Documentation

bt::Uint16 dht::DHTBase::port [protected]

Definition at line 124 of file dhtbase.h.

bool dht::DHTBase::running [protected]

Definition at line 123 of file dhtbase.h.

dht::Stats dht::DHTBase::stats [protected]

Definition at line 125 of file dhtbase.h.


The documentation for this class was generated from the following files:
  • dhtbase.h
  • dhtbase.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