Commentato il codice del server echo basato sulla funzione poll.
[gapil.git] / listati / poll_echod.c
index 91b53cefee58f03f0a9ae6d4944800d24d5b01fc..8efef2f2719c07a904266c0b158cd8bb3f9f1ca8 100644 (file)
@@ -14,7 +14,6 @@
            PrintErr("poll error");
            exit(1);
        }
            PrintErr("poll error");
            exit(1);
        }
-       /* on activity */
        if (poll_set[list_fd].revents & POLLRDNORM) {  /* if new connection */
            n--;                              /* decrement active */
            len = sizeof(c_addr);             /* and call accept */
        if (poll_set[list_fd].revents & POLLRDNORM) {  /* if new connection */
            n--;                              /* decrement active */
            len = sizeof(c_addr);             /* and call accept */
@@ -25,7 +24,6 @@
            poll_set[fd].fd = fd;             /* set new connection socket */
            if (max_fd < fd) max_fd = fd;     /* if needed set new maximum */
        }
            poll_set[fd].fd = fd;             /* set new connection socket */
            if (max_fd < fd) max_fd = fd;     /* if needed set new maximum */
        }
-       /* loop on open connections */
        i = list_fd;                  /* first socket to look */
        while (n != 0) {              /* loop until active */
            i++;                      /* start after listening socket */
        i = list_fd;                  /* first socket to look */
        while (n != 0) {              /* loop until active */
            i++;                      /* start after listening socket */
@@ -55,6 +53,5 @@
            }
        }
     }
            }
        }
     }
-    /* normal exit, never reached */
-    exit(0);
+    exit(0);     /* normal exit, never reached */
 }
 }