mirror of
https://github.com/savoirfairelinux/opendht.git
synced 2026-11-08 04:21:51 +00:00
introduce SockAddr to store IP addresses
This commit is contained in:
1 parent
8eaf78bfe2
commit
6d38c18572
15 files changed
+251
-207
No files matched your search
+3
-4
@@ -65,10 +65,9 @@ Node::getPendingMessageCount() const
|
||||
}
|
||||
|
||||
void
|
||||
Node::update(const sockaddr* sa, socklen_t salen)
|
||||
Node::update(const SockAddr& new_addr)
|
||||
{
|
||||
std::copy_n((const uint8_t*)sa, salen, (uint8_t*)&ss);
|
||||
sslen = salen;
|
||||
addr = new_addr;
|
||||
}
|
||||
|
||||
/** To be called when a message was sent to the node */
|
||||
@@ -119,7 +118,7 @@ Node::toString() const
|
||||
|
||||
std::ostream& operator<< (std::ostream& s, const Node& h)
|
||||
{
|
||||
s << h.id << " " << print_addr(h.ss, h.sslen);
|
||||
s << h.id << " " << h.addr.toString();
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user