bugfixes, temp. removed ncurses display funtions, fixed command parser.
[my-code/ivac.git] / src / network.c
index 5fae09d..9ccb2b5 100644 (file)
@@ -101,9 +101,11 @@ int network_manage_connection(t_net *net) {
             perror("[network] socket call");
             return N_ERROR;
           }
+          net->connection[i].status|=C_SOCKET;
         }
 
-        if(!net->connection[i].status&C_ESTABL) {
+        if((!net->connection[i].status&C_ESTABL)&&
+           (net->connection[i].status&C_SOCKET)) {
 
           memset(&addr,0,sizeof(struct sockaddr));
           addr.sin_family=AF_INET;
@@ -121,6 +123,7 @@ int network_manage_connection(t_net *net) {
 
           printf("[network] established connection to %s port %d on channel %d\n",
                  net->connection[i].ip,net->connection[i].port,i);
+          net->connection[i].status|=C_ESTABL;
 
         }