Skip to content
Snippets Groups Projects
Commit 958cb250 authored by Adrien Béraud's avatar Adrien Béraud
Browse files

dhtnode: show both IPv4, IPv6 bound ports

parent 6a5724a8
No related branches found
No related tags found
No related merge requests found
...@@ -49,7 +49,13 @@ void print_id_req() { ...@@ -49,7 +49,13 @@ void print_id_req() {
} }
void print_node_info(const std::shared_ptr<DhtRunner>& dht, const dht_params& params) { void print_node_info(const std::shared_ptr<DhtRunner>& dht, const dht_params& params) {
std::cout << "OpenDHT node " << dht->getNodeId() << " running on port " << dht->getBoundPort() << std::endl; std::cout << "OpenDHT node " << dht->getNodeId() << " running on ";
auto port4 = dht->getBoundPort(AF_INET);
auto port6 = dht->getBoundPort(AF_INET6);
if (port4 == port6)
std::cout << "port " << port4 << std::endl;
else
std::cout << "IPv4 port " << port4 << ", IPv6 port " << port6 << std::endl;
if (params.generate_identity) if (params.generate_identity)
std::cout << "Public key ID " << dht->getId() << std::endl; std::cout << "Public key ID " << dht->getId() << std::endl;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment