diff --git a/tools/dhtnode.cpp b/tools/dhtnode.cpp index 2b5fd01f0..c32ba050b 100644 --- a/tools/dhtnode.cpp +++ b/tools/dhtnode.cpp @@ -89,7 +89,8 @@ void print_help() { << " pp Put string value at (persistent version)." << std::endl << " cpp Cancel persistent put operation for and value ." << std::endl << " s Put string value at , signed with our generated private key." << std::endl - << " e Put string value at , encrypted for with its public key (if found)." << std::endl; + << " e Put string value at , encrypted for with its public key (if found)." << std::endl + << " cc Trigger connectivity changed signal." << std::endl; #ifdef OPENDHT_INDEXATION std::cout << std::endl << "Indexation operations on the DHT:" << std::endl @@ -179,11 +180,8 @@ void cmd_loop(std::shared_ptr& dht, dht_params& params iss >> idstr; try { auto addr = splitPort(idstr); - if (not addr.first.empty() and addr.second.empty()){ - std::stringstream ss; - ss << DHT_DEFAULT_PORT; - addr.second = ss.str(); - } + if (not addr.first.empty() and addr.second.empty()) + addr.second = std::to_string(DHT_DEFAULT_PORT); dht->bootstrap(addr.first.c_str(), addr.second.c_str()); } catch (const std::exception& e) { std::cerr << e.what() << std::endl; @@ -199,6 +197,8 @@ void cmd_loop(std::shared_ptr& dht, dht_params& params log::disableLogging(*dht); dht->setLogFilter(filter); continue; + } else if (op == "cc") { + dht->connectivityChanged(); } #if OPENDHT_PROXY_SERVER else if (op == "pst") {