libktorrent
2.1.1
|
#include <node.h>
Public Member Functions | |
Node (RPCServer *srv, const QString &key_file) | |
void | findKClosestNodes (KClosestNodesSearch &kns, bt::Uint32 want) |
bt::Uint32 | getNumEntriesInRoutingTable () const |
Get the number of entries in the routing table. | |
const dht::Key & | getOurID () const |
Get our own ID. | |
void | loadTable (const QString &file) |
Load the routing table from a file. | |
void | onTimeout (RPCMsg::Ptr msg) |
void | received (DHT *dh_table, const RPCMsg &msg) |
void | refreshBuckets (DHT *dh_table) |
Check if a buckets needs to be refreshed, and refresh if necesarry. | |
void | saveTable (const QString &file) |
Save the routing table to a file. | |
A Node represents us in the kademlia network. It contains our id and 160 KBucket's. A KBucketEntry is in node i, when the difference between our id and the KBucketEntry's id is between 2 to the power i and 2 to the power i+1.
void dht::Node::findKClosestNodes | ( | KClosestNodesSearch & | kns, |
bt::Uint32 | want | ||
) |
Find the K closest entries to a key and store them in the KClosestNodesSearch object.
kns | The object to storre the search results |
want | Which protocol(s) are wanted |
void dht::Node::onTimeout | ( | RPCMsg::Ptr | msg | ) |
Increase the failed queries count of the bucket entry we sent the message to