]> git.feebdaed.xyz Git - linuxyz.git/commitdiff
add snippet
authorseantywork <seantywork@gmail.com>
Sun, 18 May 2025 06:09:30 +0000 (06:09 +0000)
committerseantywork <seantywork@gmail.com>
Sun, 18 May 2025 06:09:30 +0000 (06:09 +0000)
ten-k/2505-03.xyz.md

index b09d95cda8142643130e9ec6737fd832915f1857..5ecb0211f2478b3e79aa02f4a52be95cde7404ae 100644 (file)
@@ -129,6 +129,22 @@ int run_epoll(int fd, struct sockaddr_in* servaddr);
 
         event = select(max_fd + 1, &readfds, NULL, NULL, NULL);
 
+...
+
+
+        for(int i = 0; i < client_num; i++){
+            if(event == 0){
+                break;
+            }
+            client_fd = client_fds[i];
+            if(client_fd == 0){
+                continue;
+            }
+            if(FD_ISSET(client_fd, &readfds)){
+                valread = 0;
+                n = 0;
+                event -= 1;
+
 ```
 
 # 06