X-Git-Url: https://gapil.gnulinux.it/gitweb/?a=blobdiff_plain;ds=sidebyside;f=listati%2FClientEcho_first.c;fp=listati%2FClientEcho_first.c;h=9a18289954704264d9e0f4cb37fc8a9ec0d103f7;hb=d25090faca15102552d77c38161a8a34b0bac41e;hp=0000000000000000000000000000000000000000;hpb=4b5c12ae4a519b8282fd3a6dcdbc33ee7dd8c3c7;p=gapil.git diff --git a/listati/ClientEcho_first.c b/listati/ClientEcho_first.c new file mode 100644 index 0000000..9a18289 --- /dev/null +++ b/listati/ClientEcho_first.c @@ -0,0 +1,12 @@ +void ClientEcho(FILE * filein, int socket) +{ + char sendbuff[MAXLINE+1], recvbuff[MAXLINE+1]; + int nread; + while (fgets(sendbuff, MAXLINE, filein) != NULL) { + FullWrite(socket, sendbuff, strlen(sendbuff)); + nread = read(socket, recvbuff, strlen(sendbuff)); + recvbuff[nread] = 0; + fputs(recvbuff, stdout); + } + return; +}