mini tester ok
This commit is contained in:
@@ -108,6 +108,13 @@ int main(int ac, char **av) {
|
||||
sprintf(msg, "server: client %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);
|
||||
if (client_fd == max_fd) {
|
||||
for(; max_fd > 2; --max_fd) {
|
||||
if (FD_ISSET(max_fd, &fdset))
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (ret > 0) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user