Skip to content

Commit

Permalink
peer discovery: add default port
Browse files Browse the repository at this point in the history
  • Loading branch information
aberaud committed May 23, 2019
1 parent e451677 commit ff6be81
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
5 changes: 3 additions & 2 deletions include/opendht/peer_discovery.h
Expand Up @@ -31,9 +31,10 @@ namespace dht {
class OPENDHT_PUBLIC PeerDiscovery
{
public:

static constexpr in_port_t DEFAULT_PORT = 8888;
using ServiceDiscoveredCallback = std::function<void(msgpack::object&&, SockAddr&&)>;
PeerDiscovery(in_port_t port);

PeerDiscovery(in_port_t port = DEFAULT_PORT);
~PeerDiscovery();

/**
Expand Down
3 changes: 1 addition & 2 deletions src/dhtrunner.cpp
Expand Up @@ -38,7 +38,6 @@ namespace dht {
constexpr std::chrono::seconds DhtRunner::BOOTSTRAP_PERIOD;
static constexpr size_t RX_QUEUE_MAX_SIZE = 1024 * 16;
static constexpr std::chrono::milliseconds RX_QUEUE_MAX_DELAY(500);
static constexpr in_port_t PEER_DISCOVERY_PORT = 8888;
static const std::string PEER_DISCOVERY_DHT_SERVICE = "dht";

struct DhtRunner::Listener {
Expand Down Expand Up @@ -157,7 +156,7 @@ DhtRunner::run(const SockAddr& local4, const SockAddr& local6, const DhtRunner::
if (config.peer_discovery or config.peer_publish) {
peerDiscovery_ = context.peerDiscovery ?
std::move(context.peerDiscovery) :
std::make_shared<PeerDiscovery>(PEER_DISCOVERY_PORT);
std::make_shared<PeerDiscovery>();
}

auto netId = config.dht_config.node_config.network;
Expand Down

0 comments on commit ff6be81

Please sign in to comment.