diff --git a/src/connectivity.c b/src/connectivity.c index d50f412..acc7cbb 100644 --- a/src/connectivity.c +++ b/src/connectivity.c @@ -50,7 +50,7 @@ static struct NeoComm_directory_node *node_list; static unsigned int max_nodes; static unsigned int num_nodes; -static int run; +static int run = 0; static int sockfd; static pthread_t accept_thread; @@ -151,6 +151,11 @@ void *NeoComm_connect_manager() { int NeoComm_init_directory(const unsigned int max_num_nodes, const unsigned short portnum) { + if(run) + { + NeoComm_error("Already running"); + return 0; + } if(max_num_nodes == 0) { NeoComm_error("Insufficient number of nodes");