clean code

This commit is contained in:
Flavien Haas 2019-10-30 21:03:06 +01:00
parent d52563a834
commit d0f3046bf5
2 changed files with 1 additions and 3 deletions

View File

@ -82,7 +82,6 @@ int main(int argc, char *argv[]) {
memset(&hints, 0, sizeof(struct addrinfo));
hints.ai_family = AF_UNSPEC; // utilisation du serveur sur IPv4/v6 (AF_INET/AF_INET6)
hints.ai_socktype = SOCK_STREAM; // socket en mode datagramme
hints.ai_protocol = IPPROTO_TCP; // protocol de connexion
s = cree_socket(ip, port, hints); // création du socket
if(s == 1) {

View File

@ -70,7 +70,7 @@ void traite_connexion(int *sfd){
if (write(new_sfd, buf, nread) != nread){
fprintf(stderr, "Erreur d'envoi de la reponse\n");
}
close(new_sfd);
close(new_sfd); /* ferme la connexion */
}
else{
fprintf(stderr, "getnameinfo: %s\n", gai_strerror(s));
@ -101,5 +101,4 @@ int main(int argc, char *argv[]){
con_client(&sfd); /* connexion au client */
traite_connexion(&sfd);
printf("traite_connexion ok\n");
}