Channel functionality will be added in the alpha
This commit is contained in:
		@@ -23,8 +23,8 @@ What follows is a list roadmap of features and the (approximate) versions in whi
 | 
			
		||||
 - v1.0-alpha:
 | 
			
		||||
  - [ ] Node connectivity
 | 
			
		||||
  - [ ] Messages properly sent and received
 | 
			
		||||
 - v1.0-beta:
 | 
			
		||||
  - [ ] Channel functionality
 | 
			
		||||
 - v1.0-beta:
 | 
			
		||||
  - [ ] Message encryption
 | 
			
		||||
  - [ ] P2P Private messages
 | 
			
		||||
 - v1.0:
 | 
			
		||||
 
 | 
			
		||||
@@ -23,11 +23,12 @@ extern "C" {
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @brief Initialize a local DHT node.
 | 
			
		||||
 * @brief Initialize a local DHT node. If port is 0 then the default port
 | 
			
		||||
 * number will be used.
 | 
			
		||||
 *
 | 
			
		||||
 * @param port The port for the node to listen on.
 | 
			
		||||
 */
 | 
			
		||||
void NeoComm_init(const unsigned short port);
 | 
			
		||||
void NeoComm_init(unsigned short port);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @brief Deinitialize the local node.
 | 
			
		||||
@@ -48,7 +49,7 @@ void NeoComm_connect(const char *address, const unsigned short port);
 | 
			
		||||
 * @param node_file Path to the node list file.
 | 
			
		||||
 *
 | 
			
		||||
 * @return 1 upon success, 0 upon failure. Use NeoComm_get_last_error for a
 | 
			
		||||
 * text version of the error.
 | 
			
		||||
 * text description of the error.
 | 
			
		||||
 */
 | 
			
		||||
int NeoComm_import_nodes(const char *node_file);
 | 
			
		||||
 | 
			
		||||
@@ -58,10 +59,20 @@ int NeoComm_import_nodes(const char *node_file);
 | 
			
		||||
 * @param node_file path to node list file.
 | 
			
		||||
 *
 | 
			
		||||
 * @return 1 upon success, 0 upon failure. Use NeoComm_get_last_error for a
 | 
			
		||||
 * text version of the error.
 | 
			
		||||
 * text description of the error.
 | 
			
		||||
 */
 | 
			
		||||
int NeoComm_export_nodes(const char *node_file);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @brief Join a channel.
 | 
			
		||||
 *
 | 
			
		||||
 * @param channel_name Name of the channel.
 | 
			
		||||
 *
 | 
			
		||||
 * @return 1 upon success, 0 upon failure. Use NeoComm_get_last_error for a
 | 
			
		||||
 * text description of the error.
 | 
			
		||||
 */
 | 
			
		||||
int NeoComm_join_channel(const char *channel_name);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @brief Get the last error that occurred in text.
 | 
			
		||||
 *
 | 
			
		||||
 
 | 
			
		||||
@@ -24,9 +24,13 @@
 | 
			
		||||
#include <string>
 | 
			
		||||
#include <fstream>
 | 
			
		||||
 | 
			
		||||
#define DEFAULT_PORT 1335
 | 
			
		||||
 | 
			
		||||
static dht::DhtRunner node;
 | 
			
		||||
 | 
			
		||||
void NeoComm_init(const unsigned short port) {
 | 
			
		||||
void NeoComm_init(unsigned short port) {
 | 
			
		||||
	if(port == 0)
 | 
			
		||||
		port = DEFAULT_PORT;
 | 
			
		||||
	node.run(port, dht::crypto::generateIdentity(), true);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user