2f219027ec5cf9871cd02c2a95e3d6906d3a837c
[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     /* do read/write operations */
15     ClientEcho(stdin, sock);
16     /* normal exit */
17     return 0;
18 }