Implemented first connect function.
This commit is contained in:
parent
9d5131ca52
commit
83ed9b2a86
@ -18,14 +18,16 @@
|
|||||||
|
|
||||||
#include "neocomm/Node.hpp"
|
#include "neocomm/Node.hpp"
|
||||||
|
|
||||||
#include <stdexcept>
|
|
||||||
|
|
||||||
neocomm::Node::Node() : status(0) { }
|
neocomm::Node::Node() : status(0) { }
|
||||||
|
|
||||||
void neocomm::Node::bind(const short &port) {
|
void neocomm::Node::bind(const short &port) {
|
||||||
node.run(port, dht::crypto::generateIdentity(), true, status);
|
node.run(port, dht::crypto::generateIdentity(), true, status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void neocomm::Node::connect(const std::string &host, const short &port) {
|
||||||
|
node.bootstrap(host.c_str(), std::to_string(port).c_str());
|
||||||
|
}
|
||||||
|
|
||||||
neocomm::Node::~Node() {
|
neocomm::Node::~Node() {
|
||||||
node.join();
|
node.join();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user