X-Git-Url: https://gapil.gnulinux.it/gitweb/?a=blobdiff_plain;f=listati%2FServEcho.c;fp=listati%2FServEcho.c;h=917c7c4d00c4b5497ee26fb2bbf7a791b6765853;hb=06661f47754a536098afe2b30cb04469918f2fa3;hp=0000000000000000000000000000000000000000;hpb=bdf6e88eeb9b3aef06d57930ec8b89083639e56d;p=gapil.git diff --git a/listati/ServEcho.c b/listati/ServEcho.c new file mode 100644 index 0000000..917c7c4 --- /dev/null +++ b/listati/ServEcho.c @@ -0,0 +1,10 @@ +void ServEcho(int sockfd) { + char buffer[MAXLINE]; + int nread, nwrite; + + /* main loop, reading 0 char means client close connection */ + while ( (nread = read(sockfd, buffer, MAXLINE)) != 0) { + nwrite = FullWrite(sockfd, buffer, nread); + } + return; +}