mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-07 22:22:45 -04:00
* Added new interface functions for start / stop DHT and to get stats.
* Implemented start/stop interface in udpbitdht and bemanager * added Restart of DHT if it fails to get going. * added start / stop functionality to bdnode and bdstore * added cleanup code to rest of bitdht classes. * reworked NetworkSize calc functions. * added thread debugging (prints at start / stop / join). * TESTS: added utest.h header file for automated unit testing (from libretroshare) * TESTS: bdmetric_test started conversion to automated tests * TESTS: udpbitdht_nettest. Added dht start / stop and network reset (thread join) functionality. * TESTS: fresh bdboot.txt git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3678 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
884f0e7a22
commit
74961774cc
18 changed files with 1193 additions and 601 deletions
|
@ -70,11 +70,13 @@ class bdQueryPeer
|
|||
};
|
||||
|
||||
|
||||
#define BITDHT_MGR_STATE_OFF 0
|
||||
#define BITDHT_MGR_STATE_STARTUP 1
|
||||
#define BITDHT_MGR_STATE_FINDSELF 2
|
||||
#define BITDHT_MGR_STATE_ACTIVE 3
|
||||
#define BITDHT_MGR_STATE_REFRESH 4
|
||||
#define BITDHT_MGR_STATE_QUIET 5
|
||||
#define BITDHT_MGR_STATE_FAILED 6
|
||||
|
||||
#define MAX_STARTUP_TIME 10
|
||||
#define MAX_REFRESH_TIME 10
|
||||
|
@ -112,6 +114,12 @@ virtual void removeCallback(BitDhtCallback *cb);
|
|||
virtual int getDhtPeerAddress(const bdNodeId *id, struct sockaddr_in &from);
|
||||
virtual int getDhtValue(const bdNodeId *id, std::string key, std::string &value);
|
||||
|
||||
/* stats and Dht state */
|
||||
virtual int startDht();
|
||||
virtual int stopDht();
|
||||
virtual int stateDht(); /* STOPPED, STARTING, ACTIVE, FAILED */
|
||||
virtual uint32_t statsNetworkSize();
|
||||
virtual uint32_t statsBDVersionSize(); /* same version as us! */
|
||||
/******************* Internals *************************/
|
||||
|
||||
// Overloaded from bdnode for external node callback.
|
||||
|
@ -140,6 +148,9 @@ void startQueries();
|
|||
|
||||
bdDhtFunctions *mFns;
|
||||
|
||||
uint32_t mNetworkSize;
|
||||
uint32_t mBdNetworkSize;
|
||||
|
||||
/* future node functions */
|
||||
//addPeerPing(foundId);
|
||||
//clearPing(it->first);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue