Check if already started.
This commit is contained in:
parent
7222ad3e2a
commit
84ba3aa83c
@ -50,7 +50,7 @@ static struct NeoComm_directory_node *node_list;
|
|||||||
static unsigned int max_nodes;
|
static unsigned int max_nodes;
|
||||||
static unsigned int num_nodes;
|
static unsigned int num_nodes;
|
||||||
|
|
||||||
static int run;
|
static int run = 0;
|
||||||
static int sockfd;
|
static int sockfd;
|
||||||
|
|
||||||
static pthread_t accept_thread;
|
static pthread_t accept_thread;
|
||||||
@ -151,6 +151,11 @@ void *NeoComm_connect_manager() {
|
|||||||
|
|
||||||
int NeoComm_init_directory(const unsigned int max_num_nodes,
|
int NeoComm_init_directory(const unsigned int max_num_nodes,
|
||||||
const unsigned short portnum) {
|
const unsigned short portnum) {
|
||||||
|
if(run)
|
||||||
|
{
|
||||||
|
NeoComm_error("Already running");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
if(max_num_nodes == 0)
|
if(max_num_nodes == 0)
|
||||||
{
|
{
|
||||||
NeoComm_error("Insufficient number of nodes");
|
NeoComm_error("Insufficient number of nodes");
|
||||||
|
Loading…
Reference in New Issue
Block a user