X-Git-Url: https://gapil.gnulinux.it/gitweb/?p=gapil.git;a=blobdiff_plain;f=sources%2FTCP_echod_first.c;h=31e3c16c70a379990b06b17fd11dc398b8a72822;hp=b1356fe3f55213daae0bf5109fa2c1fa22c47370;hb=31f55ec58bee8b2c4993633849b7da4e30cab222;hpb=49ae2790472cc2ad1e54ea26d037306598f9c83b diff --git a/sources/TCP_echod_first.c b/sources/TCP_echod_first.c index b1356fe..31e3c16 100644 --- a/sources/TCP_echod_first.c +++ b/sources/TCP_echod_first.c @@ -20,28 +20,29 @@ * * Program echod * Elementary TCP server for echo service (port 7) + * First version * * Author: Simone Piccardi * Jun. 2001 * * Usage: echod -h give all info * - * $Id: TCP_echod_first.c,v 1.2 2003/07/27 23:41:04 piccardi Exp $ - * ****************************************************************/ /* * Include needed headers */ -#include /* predefined types */ -#include /* include unix standard library */ +#include /* primitive system data types */ +#include /* unix standard library */ #include /* IP addresses conversion utiliites */ -#include /* socket library */ -#include /* include standard I/O library */ -#include +#include /* socket constants, types and functions */ +#include /* standard I/O library */ +#include /* date and time constants, types and functions */ #include /* syslog system functions */ #include /* signal functions */ -#include /* error code */ -#include /* error strings */ +#include /* error definitions and routines */ +#include /* C strings library */ +#include /* C standard library */ + #include "Gapil.h" #define BACKLOG 10 @@ -138,6 +139,7 @@ int main(int argc, char *argv[]) /* handle echo to client */ while (1) { /* accept connection */ + len = sizeof(cli_add); if ( (conn_fd = accept(list_fd, NULL, NULL)) < 0) { PrintErr("accept error"); exit(1);