]> hackdaworld.org Git - my-code/ivac.git/commitdiff
added network_close_all function
authorhackbard <hackbard>
Wed, 12 May 2004 07:52:19 +0000 (07:52 +0000)
committerhackbard <hackbard>
Wed, 12 May 2004 07:52:19 +0000 (07:52 +0000)
src/network.c
src/network.h

index 3579f5ab8aff8a945492a917d7dba6caf7a21d04..55fa2c6a8addaf2d9a92d2fb91f9926c15b6af57 100644 (file)
@@ -163,6 +163,16 @@ int network_close(t_net *net,int channel) {
   return(network_manage_connection(net)); /* could be other channel too */
 }
 
+int network_close_all(t_net *net) {
+
+  int channel;
+
+  for(channel=0;channel<MAX_CONNECTIONS;channel++)
+    if(net->connection[channel].status&C_ESTABL) network_close(net,channel);
+
+  return N_SUCCESS;
+}
+
 int network_set_connection_info(t_net *net,int channel,char *ip,int port) {
 
   if(net->connection[channel].status&C_IN_USE) {
index 14168bfb2d835b69cd11d3dbc06c4f8930adf93d..25a9891522eeca8b64295d819ae7f3bbcb99fd71 100644 (file)
@@ -65,6 +65,7 @@ int network_set_listen_port(t_net *net,in_port_t port);
 int network_manage_connection(t_net *net);
 int network_connect(t_net *net,int channel);
 int network_close(t_net *net,int channel);
+int network_close_all(t_net *net);
 int network_set_connection_info(t_net *net,int channel,char *ip,int port);
 int network_select(t_net *net,int channel);
 int network_deselect(t_net *net,int channel);