some changes to network api
authorhackbard <hackbard>
Thu, 28 Oct 2004 18:53:51 +0000 (18:53 +0000)
committerhackbard <hackbard>
Thu, 28 Oct 2004 18:53:51 +0000 (18:53 +0000)
network/network.c
network/network.h

index 1160e7c..aefb7c2 100644 (file)
@@ -7,17 +7,22 @@
 #include "network.h"
 
 int network_init(t_net *net,int outfd) {
-  
-  struct sockaddr_in addr;
-  int true;
-  dprintf(outfd,"[network] initializing network ...\n");
+
+  dprintf(net->outfd,"[network] initializing network api ...\n");
 
   memset(net->connection,0,MAX_CONNECTIONS*sizeof(t_connection));
   net->c_count=0;
   net->sendmask=0;
   net->outfd=outfd;
 
+  return N_SUCCESS;
+}
+
+int network_listen(t_net *net) {
+  
+  struct sockaddr_in addr;
+  int true;
+
   if((net->l_fd=socket(AF_INET,SOCK_STREAM,0))==-1) {
     perror("[network] socket call");
     return N_ERROR;
index d234d9c..281a43f 100644 (file)
@@ -68,6 +68,7 @@ typedef struct s_net {
 
 /* function prototypes */
 int network_init(t_net *net,int outfd);
+int network_listen(t_net *net);
 int network_shutdown(t_net *net);
 int network_set_listen_port(t_net *net,in_port_t port);
 int network_manage_connection(t_net *net);