mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-12 19:12:28 -04:00
Changes to get DHT On/Off working, and get DHT status working too:
* Plumbed stats through the the retroshare interface. * Also changed Channel store period back to 10 minutes.... (Reduce overall file count). This must be done some time before the any changes are made to Channels periods. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3721 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
89ca27ef66
commit
519075c70b
10 changed files with 126 additions and 64 deletions
|
@ -118,35 +118,52 @@ void p3BitDht::start()
|
|||
|
||||
mUdpBitDht->start(); /* starts up the bitdht thread */
|
||||
|
||||
/* switch on the dht too */
|
||||
mUdpBitDht->startDht();
|
||||
/* dht switched on by config later. */
|
||||
}
|
||||
|
||||
/* pqiNetAssist - external interface functions */
|
||||
void p3BitDht::enable(bool on)
|
||||
{
|
||||
//mUdpBitDht->enable(on);
|
||||
std::cerr << "p3BitDht::enable(" << on << ")";
|
||||
std::cerr << std::endl;
|
||||
|
||||
if (on)
|
||||
{
|
||||
mUdpBitDht->startDht();
|
||||
}
|
||||
else
|
||||
{
|
||||
mUdpBitDht->stopDht();
|
||||
}
|
||||
}
|
||||
|
||||
void p3BitDht::shutdown() /* blocking call */
|
||||
{
|
||||
//mUdpBitDht->shutdown();
|
||||
mUdpBitDht->stopDht();
|
||||
}
|
||||
|
||||
|
||||
void p3BitDht::restart()
|
||||
{
|
||||
//mUdpBitDht->restart();
|
||||
mUdpBitDht->stopDht();
|
||||
mUdpBitDht->startDht();
|
||||
}
|
||||
|
||||
bool p3BitDht::getEnabled()
|
||||
{
|
||||
return false;
|
||||
return (mUdpBitDht->stateDht() != 0);
|
||||
}
|
||||
|
||||
bool p3BitDht::getActive()
|
||||
{
|
||||
return false;
|
||||
return (mUdpBitDht->stateDht() >= BITDHT_MGR_STATE_ACTIVE);
|
||||
}
|
||||
|
||||
bool p3BitDht::getNetworkStats(uint32_t &netsize, uint32_t &localnetsize)
|
||||
{
|
||||
netsize = mUdpBitDht->statsNetworkSize();
|
||||
localnetsize = mUdpBitDht->statsBDVersionSize();
|
||||
return true;
|
||||
}
|
||||
|
||||
/* pqiNetAssistConnect - external interface functions */
|
||||
|
|
|
@ -56,6 +56,7 @@ virtual void restart();
|
|||
|
||||
virtual bool getEnabled();
|
||||
virtual bool getActive();
|
||||
virtual bool getNetworkStats(uint32_t &netsize, uint32_t &localnetsize);
|
||||
|
||||
/* pqiNetAssistConnect - external interface functions */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue