dht: add message counting

This commit is contained in:
Adrien Béraud committed 2015-10-06 11:58:26 -04:00
1 parent 80363a9343
commit eea097961a
5 files changed
+37

No files matched your search

+6
View File
@@ -269,6 +269,12 @@ cdef class DhtRunner(_WithID):
return self.thisptr.getRoutingTablesLog(af).decode()
def getSearchesLog(self, cpp.sa_family_t af):
return self.thisptr.getSearchesLog(af).decode()
def getNodeMessageStats(self):
stats = []
cdef cpp.vector[unsigned] res = self.thisptr.getNodeMessageStats(False)
for n in res:
stats.append(n)
return stats
def get(self, InfoHash key, get_cb=None, done_cb=None):
"""Retreive values associated with a key on the DHT.
+1
View File
@@ -127,5 +127,6 @@ cdef extern from "opendht/dhtrunner.h" namespace "dht":
void put(InfoHash key, shared_ptr[Value] val, Dht.DoneCallback done_cb)
ListenToken listen(InfoHash key, Dht.GetCallback get_cb)
void cancelListen(InfoHash key, SharedListenToken token)
vector[unsigned] getNodeMessageStats(bool i)
ctypedef DhtRunner.Config Config