Modifiche rimaste indietro.
[gapil.git] / listati / TCP_echo_fifth.c
1 int main(int argc, char *argv[])
2 {
3 /* 
4  * Variables definition  
5  */
6     int sock, i;
7     int reset = 0;
8     ...
9     /* call sockaddr to get a connected socket */
10     if ( (sock = sockconn(argv[optind], "echo", 6, SOCK_STREAM)) < 0) {
11         if (errno) perror("Socket creation error");
12         return 1;
13     }
14     ...
15     /* do read/write operations */
16     ClientEcho(stdin, sock);
17     /* normal exit */
18     return 0;
19 }