some additions in tests
This commit is contained in:
@@ -93,11 +93,10 @@ int main(int ac, char **av) {
|
||||
|
||||
client_fd = 0;
|
||||
while(client_fd <= max_fd) {
|
||||
ret = 1;
|
||||
if (FD_ISSET(client_fd, &rdset)) {
|
||||
ret = recv(client_fd, buf, BUFSIZE, 0);
|
||||
if (ret == 0) {
|
||||
sprintf(msg, "server: client %d just left\n", clients[client_fd].id);
|
||||
sprintf(msg, "server: clien %d just left\n", clients[client_fd].id);
|
||||
broadcast(msg, &fdset, max_fd, server_fd, client_fd);
|
||||
FD_CLR(client_fd, &fdset);
|
||||
close(client_fd);
|
||||
|
||||
Reference in New Issue
Block a user