clean code
This commit is contained in:
parent
d52563a834
commit
d0f3046bf5
@ -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) {
|
||||
|
@ -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");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user