dhtrunner: migrate to SockAddr, use default port if not set

This commit is contained in:
Adrien Béraud committed 2019-08-02 14:42:26 -04:00
1 parent a8718242cd
commit 84a9d899d5
11 files changed
+37 -32

No files matched your search

+7
View File
@@ -37,6 +37,13 @@ Node::Node(const InfoHash& id, const SockAddr& addr, bool client)
transaction_id = std::uniform_int_distribution<Tid>{1}(rd);
}
Node::Node(const InfoHash& id, SockAddr&& addr, bool client)
: id(id), addr(std::move(addr)), is_client(client), sockets_()
{
thread_local crypto::random_device rd {};
transaction_id = std::uniform_int_distribution<Tid>{1}(rd);
}
/* This is our definition of a known-good node. */
bool
Node::isGood(time_point now) const