Added a few new functions.

This commit is contained in:
Nicolás Ortega Froysa
2018-04-01 16:29:40 +02:00
parent 2c5b104b82
commit d695daf736
2 changed files with 107 additions and 1 deletions

View File

@ -48,6 +48,28 @@ public:
unsigned short port = 8085);
~node();
/**
* @brief Connect the node to a given address.
*
* @param address The IP or domain name of the other node.
* @param port The port of the other node.
*/
void connect(const std::string &address,
unsigned short port);
/**
* @brief Import and connect to a list of nodes from a
* previous session.
*
* @param node_file File containing the node list.
*/
void import_nodes(const std::string &node_file);
/**
* @brief Export currently connected nodes to a file.
*
* @param node_file File to export nodes to.
*/
void export_nodes(const std::string &node_file);
private:
dht::DhtRunner dht_node;
};