From 1ef874545132e9245bb241a14d33a2ad09f689c1 Mon Sep 17 00:00:00 2001 From: Adam Toppmayer Date: Sat, 9 Nov 2019 22:42:58 +0000 Subject: [PATCH] Zaktualizuj 'server/server.c' --- server/server.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/server.c b/server/server.c index 96759a9..aa205ea 100644 --- a/server/server.c +++ b/server/server.c @@ -73,12 +73,12 @@ int main(void) { //Sprawdzenie Poprawności //printf("Przed Select\n"); - if(select(socket_bind+1, &Socket, NULL, NULL, NULL) < 0) { + if(select(socket_bind+1, &Socket, NULL, NULL, NULL) > 0) { if (FD_ISSET(socket_bind, &Socket)) { temp_accept = accept(socket_bind, (struct sockaddr*) &client[i].accept_adr, &dl) for(i=0;i<=4;i++){ if (client[i].socket == temp_accept){ - recv(client[i].socket, &msg, 1024, 0); + recv(client[i].socket, msg, 1024, 0); break; } } @@ -106,7 +106,7 @@ int main(void) { } printf("Wiadomość:%s\n", msg); //PRZETWARZANIE WIADOMOŚCI - if(select(max_fd+1, NULL, &Clients, NULL, NULL) < 0) { + if(select(max_fd+1, NULL, &Clients, NULL, NULL) > 0) { for(i=0;i<=4;i++){ if (FD_ISSET(client[i].socket, &Clients)) {