buffer size increased

This commit is contained in:
asus
2023-02-20 12:40:54 +01:00
parent b8a8ac201e
commit 6fb2d64bdc
3 changed files with 13 additions and 11 deletions
BIN
View File
Binary file not shown.
+2 -3
View File
@@ -8,7 +8,7 @@
#include <stdio.h> #include <stdio.h>
#define MSGSIZE 1024 #define MSGSIZE 1024
#define BUFSIZE MSGSIZE + 20 #define BUFSIZE MSGSIZE + 120000
typedef struct s_client { typedef struct s_client {
int id; int id;
@@ -96,7 +96,7 @@ int main(int ac, char **av) {
if (FD_ISSET(client_fd, &rdset)) { if (FD_ISSET(client_fd, &rdset)) {
ret = recv(client_fd, buf, BUFSIZE, 0); ret = recv(client_fd, buf, BUFSIZE, 0);
if (ret == 0) { if (ret == 0) {
sprintf(msg, "server: clien %d just left\n", clients[client_fd].id); sprintf(msg, "server: client %d just left\n", clients[client_fd].id);
broadcast(msg, &fdset, max_fd, server_fd, client_fd); broadcast(msg, &fdset, max_fd, server_fd, client_fd);
FD_CLR(client_fd, &fdset); FD_CLR(client_fd, &fdset);
close(client_fd); close(client_fd);
@@ -127,4 +127,3 @@ int main(int ac, char **av) {
return(0); return(0);
} }
+11 -8
View File
File diff suppressed because one or more lines are too long