diff --git a/tsock_v4.c b/tsock_v4.c index a6058af..292218d 100644 --- a/tsock_v4.c +++ b/tsock_v4.c @@ -392,7 +392,7 @@ int main (int argc, char **argv) { exit(1); } - while (1) { + while (sock != 0) { //acceptation d'une demande de connexion if((sock_bis=accept(sock,(struct sockaddr *)&adr_em, &lg_adr_em)) == -1) { @@ -409,6 +409,7 @@ int main (int argc, char **argv) { break; case 0: close(sock); + sock = 0; if (source == 1) { //envoi for(i=0; i