c150ad473bbe97b7ad3df992cf222c95016b95da
[gapil.git] / listati / TCP_echod_third.c
1 int main(int argc, char *argv[])
2 {
3 /* 
4  * Variables definition  
5  */
6     int list_fd, conn_fd;
7     ...
8     /* Main code begin here */
9     if (compat) {                             /* install signal handler */
10         Signal(SIGCHLD, HandSigCHLD);         /* non restarting handler */
11     } else {
12         SignalRestart(SIGCHLD, HandSigCHLD);  /* restarting handler */
13     }
14     /* create and bind socket */
15     if ( (list_fd = sockbind(argv[optind], "echo", 6, SOCK_STREAM)) < 0) {
16         if (errno) perror("Socket creation error");
17         return 1;
18     }   
19     ...
20 }