Skip to content

Commit

Permalink
Ajout erreur si socket read renvoies une erreur
Browse files Browse the repository at this point in the history
  • Loading branch information
abyfall committed Dec 8, 2017
1 parent ba49883 commit 0c4f34f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions serveur/sources/service.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,10 @@ void recevoirMessage(int descripteurSocketService, char *commandeRecu)
{
int sizeRead;
sizeRead = read(descripteurSocketService, commandeRecu, SIZE_MSG);
if(sizeRead == -1 || sizeRead == 0){
fprintf(stderr, RED"Erreur lecture socket!\n"RESET);
exit(-1);
}
printf("Commande reçu du client : %s (taille = %d)\n", commandeRecu, sizeRead);
}

Expand Down

0 comments on commit 0c4f34f

Please sign in to comment.