Sistemati client e server echo
[gapil.git] / sources / SimpleEchoTCPClient.c
index 73654529b7f825e3da66d66d4ce994c46d54db91..31adf9fdabc7793ab906b6af25e8658f055cd854 100644 (file)
@@ -8,7 +8,7 @@
  *
  * Usage: echo -h give all info's
  *
- * $Id: SimpleEchoTCPClient.c,v 1.2 2001/06/13 17:17:15 piccardi Exp $
+ * $Id: SimpleEchoTCPClient.c,v 1.3 2001/06/17 21:58:46 piccardi Exp $
  *
  ****************************************************************/
 /* 
@@ -105,10 +105,7 @@ void EchoClient(FILE * filein, int socket)
     int nread; 
     while (fgets(sendbuff, MAXLINE, filein) != NULL) {
        SockWrite(socket, sendbuff, strlen(sendbuff)); 
-       if ( (nread = read(socket, recvbuff, MAXLINE)) == 0) {
-           perror("Sever read error:");
-           exit(-1);
-       }
+       nread = SockRead(socket, recvbuff, strlen(sendbuff));
        recvbuff[nread] = 0;
        fputs(recvbuff, stdout);
     }