Skip to content
Permalink
Browse files

dhtrunner: add bootstrap method with single arg. host:service

  • Loading branch information...
aberaud committed Aug 2, 2019
1 parent 84a9d89 commit 25c9375d95c1902846c16277ee7520754a17f397
Showing with 11 additions and 0 deletions.
  1. +1 −0 include/opendht/dhtrunner.h
  2. +10 −0 src/dhtrunner.cpp
@@ -271,6 +271,7 @@ class OPENDHT_PUBLIC DhtRunner {
* to the DHT network is established.
*/
void bootstrap(const std::string& host, const std::string& service);
void bootstrap(const std::string& hostService);

/**
* Insert known nodes to the routing table, without necessarly ping them.
@@ -832,6 +832,16 @@ DhtRunner::bootstrap(const std::string& host, const std::string& service)
tryBootstrapContinuously();
}

void
DhtRunner::bootstrap(const std::string& hostService)
{
std::lock_guard<std::mutex> lck(bootstrap_mtx);
auto host_service = splitPort(hostService);
bootstrap_nodes_all.emplace_back(host_service.first, host_service.second);
bootstrap_nodes.emplace_back(std::move(host_service.first), std::move(host_service.second));
tryBootstrapContinuously();
}

void
DhtRunner::clearBootstrap()
{

0 comments on commit 25c9375

Please sign in to comment.
You can’t perform that action at this time.