New shutdown function.
This commit is contained in:
parent
a393cb8b4e
commit
0db8eb82e9
@ -30,3 +30,8 @@
|
|||||||
* else 0 is returned.
|
* else 0 is returned.
|
||||||
*/
|
*/
|
||||||
int NeoComm_init(unsigned int max_nodes);
|
int NeoComm_init(unsigned int max_nodes);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Disconnect all currently active connections and shutdown all modules.
|
||||||
|
*/
|
||||||
|
void NeoComm_shutdown();
|
||||||
|
@ -27,6 +27,9 @@ struct address {
|
|||||||
unsigned short port; ///< Port of address.
|
unsigned short port; ///< Port of address.
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Structure used for NeoComm nodes.
|
||||||
|
*/
|
||||||
struct node {
|
struct node {
|
||||||
/// The address of the node.
|
/// The address of the node.
|
||||||
struct address address;
|
struct address address;
|
||||||
@ -50,7 +53,10 @@ struct node {
|
|||||||
*/
|
*/
|
||||||
int NeoComm_init_nodes(unsigned int max_nodes);
|
int NeoComm_init_nodes(unsigned int max_nodes);
|
||||||
|
|
||||||
void NeoComm_deinit_nodes();
|
/**
|
||||||
|
* @brief Deinitialize all the nodes.
|
||||||
|
*/
|
||||||
|
void NeoComm_shutdown_nodes();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Enlarge the list.
|
* @brief Enlarge the list.
|
||||||
|
@ -24,3 +24,7 @@ int NeoComm_init(unsigned int max_nodes) {
|
|||||||
return 0;
|
return 0;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void NeoComm_shutdown() {
|
||||||
|
NeoComm_shutdown_nodes();
|
||||||
|
}
|
||||||
|
@ -40,7 +40,9 @@ int NeoComm_init_nodes(unsigned int max_nodes) {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void NeoComm_deinit_nodes() {
|
void NeoComm_shutdown_nodes() {
|
||||||
|
if(!node_list)
|
||||||
|
return;
|
||||||
free(node_list);
|
free(node_list);
|
||||||
node_max = 0;
|
node_max = 0;
|
||||||
node_count = 0;
|
node_count = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user