serveur recepteur recoit plusieurs messages

This commit is contained in:
nbillard 2023-02-13 09:30:52 +01:00
parent 8e7082a9cb
commit 5c17cf7f6d
2 changed files with 15 additions and 14 deletions

1
.gitignore vendored
View file

@ -5,3 +5,4 @@ tmp/
a.out a.out
tsock_V3

View file

@ -413,21 +413,21 @@ int main (int argc, char **argv) {
} else { } else {
//reception //reception
lg_max=lg_mesg; lg_max=lg_mesg;
/* if (nb_message == -1) { */ if (nb_message == -1) {
count = 0; count = 0;
while ((lg_mesg=recv(sock_bis, pmesg, lg_max, 0))>0) { while ((lg_mesg=recv(sock_bis, pmesg, lg_max, 0))>0) {
count++; count++;
printf("PUITS: Reception "); printf("PUITS: Reception ");
afficher_message(pmesg, lg_mesg, count); afficher_message(pmesg, lg_mesg, count);
}
} else {
for (int k=0; k<nb_message; k++) {
if ((lg_mesg=recv(sock_bis, pmesg, lg_max, 0))>0) {
printf("PUITS: Reception ");
afficher_message(pmesg, lg_mesg, (k+1));
}
}
} }
/* } else { */
/* for (int k=0; k<nb_message; k++) { */
/* if ((lg_mesg=recv(sock_bis, pmesg, lg_max, 0))>0) { */
/* printf("PUITS: Reception "); */
/* afficher_message(pmesg, lg_mesg, (k+1)); */
/* } */
/* } */
/* } */
} }
} }