mirror of
https://github.com/savoirfairelinux/opendht.git
synced 2026-11-08 04:21:51 +00:00
node: add toString()
This commit is contained in:
1 parent
92df1f5a2b
commit
15f4ea4d88
2 files changed
+12
No files matched your search
@@ -21,6 +21,8 @@
|
||||
|
||||
#include "node.h"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
namespace dht {
|
||||
|
||||
constexpr std::chrono::minutes Node::NODE_EXPIRE_TIME;
|
||||
@@ -77,6 +79,14 @@ Node::received(time_point now, bool answer)
|
||||
}
|
||||
}
|
||||
|
||||
std::string
|
||||
Node::toString() const
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << (*this);
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
std::ostream& operator<< (std::ostream& s, const Node& h)
|
||||
{
|
||||
s << h.id << " " << print_addr(h.ss, h.sslen);
|
||||
|
||||
Reference in new issue
Block a user