node: add pendingMesageCount

This commit is contained in:
Adrien Béraud committed 2016-05-24 03:44:18 -04:00
1 parent ac23464044
commit 6cdc242b6e
3 files changed
+18 -3

No files matched your search

+14 -1
View File
@@ -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)
{