mirror of
https://github.com/savoirfairelinux/opendht.git
synced 2026-11-08 04:21:51 +00:00
node: add pendingMesageCount
This commit is contained in:
1 parent
ac23464044
commit
6cdc242b6e
3 files changed
+18
-3
No files matched your search
+14
-1
@@ -40,7 +40,7 @@ Node::isGood(time_point now) const
|
||||
}
|
||||
|
||||
bool
|
||||
Node::isMessagePending() const
|
||||
Node::isPendingMessage() const
|
||||
{
|
||||
for (auto w : requests_) {
|
||||
if (auto r = w.lock()) {
|
||||
@@ -51,6 +51,19 @@ Node::isMessagePending() const
|
||||
return false;
|
||||
}
|
||||
|
||||
size_t
|
||||
Node::getPendingMessageCount() const
|
||||
{
|
||||
size_t count {0};
|
||||
for (auto w : requests_) {
|
||||
if (auto r = w.lock()) {
|
||||
if (r->pending())
|
||||
count++;
|
||||
}
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
void
|
||||
Node::update(const sockaddr* sa, socklen_t salen)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user