X-Git-Url: https://gapil.gnulinux.it/gitweb/?p=gapil.git;a=blobdiff_plain;f=sources%2FSimpleEchoTCPClient.c;h=70855ad5e8a6c8d7340c341cb83fb22691c78d02;hp=31adf9fdabc7793ab906b6af25e8658f055cd854;hb=a051e3c3d3b403ee210274d8c2ec7d756c531a21;hpb=4ff5f41266fec476e9a8d2d2d2cf4c58f8bb5590 diff --git a/sources/SimpleEchoTCPClient.c b/sources/SimpleEchoTCPClient.c index 31adf9f..70855ad 100644 --- a/sources/SimpleEchoTCPClient.c +++ b/sources/SimpleEchoTCPClient.c @@ -1,6 +1,24 @@ +/* SimpleEchoTCPClient.c + * + * Copyright (C) 2001 Simone Piccardi + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or (at + * your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ /**************************************************************** * - * Program SimpleEchoTCPClient: + * Program echo: * Simple TCP client for echo service (port 7) * * Author: Simone Piccardi @@ -8,7 +26,7 @@ * * Usage: echo -h give all info's * - * $Id: SimpleEchoTCPClient.c,v 1.3 2001/06/17 21:58:46 piccardi Exp $ + * $Id: SimpleEchoTCPClient.c,v 1.6 2003/02/02 20:35:33 piccardi Exp $ * ****************************************************************/ /* @@ -20,8 +38,6 @@ #include /* socket library */ #include /* include standard I/O library */ -#include "wrappers.h" - #define MAXLINE 256 void usage(void); void EchoClient(FILE * filein, int socket); @@ -104,8 +120,8 @@ void EchoClient(FILE * filein, int socket) char sendbuff[MAXLINE], recvbuff[MAXLINE]; int nread; while (fgets(sendbuff, MAXLINE, filein) != NULL) { - SockWrite(socket, sendbuff, strlen(sendbuff)); - nread = SockRead(socket, recvbuff, strlen(sendbuff)); + FullWrite(socket, sendbuff, strlen(sendbuff)); + nread = FullRead(socket, recvbuff, strlen(sendbuff)); recvbuff[nread] = 0; fputs(recvbuff, stdout); }