serveur recepteur recoit plusieurs messages
This commit is contained in:
parent
8e7082a9cb
commit
5c17cf7f6d
2 changed files with 15 additions and 14 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -5,3 +5,4 @@ tmp/
|
|||
|
||||
|
||||
a.out
|
||||
tsock_V3
|
||||
|
|
28
tsock_v4.c
28
tsock_v4.c
|
@ -413,21 +413,21 @@ int main (int argc, char **argv) {
|
|||
} else {
|
||||
//reception
|
||||
lg_max=lg_mesg;
|
||||
/* if (nb_message == -1) { */
|
||||
count = 0;
|
||||
while ((lg_mesg=recv(sock_bis, pmesg, lg_max, 0))>0) {
|
||||
count++;
|
||||
printf("PUITS: Reception ");
|
||||
afficher_message(pmesg, lg_mesg, count);
|
||||
if (nb_message == -1) {
|
||||
count = 0;
|
||||
while ((lg_mesg=recv(sock_bis, pmesg, lg_max, 0))>0) {
|
||||
count++;
|
||||
printf("PUITS: Reception ");
|
||||
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)); */
|
||||
/* } */
|
||||
/* } */
|
||||
/* } */
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue