From: hackbard Date: Wed, 12 May 2004 07:52:19 +0000 (+0000) Subject: added network_close_all function X-Git-Url: https://hackdaworld.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=25e53b7c9b49f76c122a7425f6533de17810759b;p=my-code%2Fivac.git added network_close_all function --- diff --git a/src/network.c b/src/network.c index 3579f5a..55fa2c6 100644 --- a/src/network.c +++ b/src/network.c @@ -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;channelconnection[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) { diff --git a/src/network.h b/src/network.h index 14168bf..25a9891 100644 --- a/src/network.h +++ b/src/network.h @@ -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);