Correzioni rimaste indietro ed espansione funzioni del resolver.
[gapil.git] / listati / TCP_echod_fourth.c
1 int main(int argc, char *argv[])
2 {
3 /* 
4  * Variables definition  
5  */
6     int list_fd, conn_fd;
7     int waiting = 0;
8     int keepalive = 0;
9     ...
10     ... 
11
12         if (pid == 0) {      /* child */
13             close(list_fd);          /* close listening socket */   
14             if (keepalive) {         /* enable keepalive ? */
15                 setsockopt(conn_fd, SOL_SOCKET, SO_KEEPALIVE, 
16                            &keepalive, sizeof(keepalive));
17             }
18             ServEcho(conn_fd);       /* handle echo */
19             ...
20 }