mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-03 14:45:12 -04:00
Modified previous example into a Single Shot Search for RPC support.
Takes 2 - 3 minutes to run at the moment. Got to make it faster! git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-gxs-b1@5732 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
72d3c868e3
commit
1a1e453c7e
6 changed files with 674 additions and 553 deletions
|
@ -37,6 +37,18 @@
|
|||
/*** This class can be overloaded to use the XXXXCallback() Functions *****/
|
||||
class BitDhtIntCallback;
|
||||
|
||||
|
||||
class BssResult
|
||||
{
|
||||
public:
|
||||
bdId id;
|
||||
uint32_t mode; // single shot
|
||||
uint32_t status; // SEARCHING, FAILURE, FOUND, MULTIPLE HITS.
|
||||
};
|
||||
|
||||
#define BSS_SINGLE_SHOT 0x0001
|
||||
|
||||
|
||||
class BitDhtHandler
|
||||
{
|
||||
|
||||
|
@ -58,12 +70,17 @@ virtual int NodeCallback(const bdId *id, uint32_t peerflags);
|
|||
virtual int PeerCallback(const bdId *id, uint32_t status);
|
||||
virtual int ValueCallback(const bdNodeId *id, std::string key, uint32_t status);
|
||||
|
||||
bool SearchResult(bdId *id, uint32_t &status);
|
||||
|
||||
private:
|
||||
|
||||
/* real DHT classes */
|
||||
UdpStack *mStack;
|
||||
UdpBitDht *mUdpBitDht;
|
||||
|
||||
bdMutex resultsMtx; /* for all class data (below) */
|
||||
|
||||
std::map<bdNodeId, BssResult> mSearchNodes;
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue