projects
/
gapil.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Ancora correzioni sulle varie versioni di server.
[gapil.git]
/
sources
/
ElemEchoTCPClient.c
diff --git
a/sources/ElemEchoTCPClient.c
b/sources/ElemEchoTCPClient.c
index 57b8fa1e3a94bcee4018ac14ddb92cf3afee2444..942b21a203ce683f7182f9dcdecc75ed8446805e 100644
(file)
--- a/
sources/ElemEchoTCPClient.c
+++ b/
sources/ElemEchoTCPClient.c
@@
-26,7
+26,7
@@
*
* Usage: echo -h give all info's
*
*
* Usage: echo -h give all info's
*
- * $Id: ElemEchoTCPClient.c,v 1.
3 2001/09/09 22:45:34
piccardi Exp $
+ * $Id: ElemEchoTCPClient.c,v 1.
8 2003/05/02 09:55:13
piccardi Exp $
*
****************************************************************/
/*
*
****************************************************************/
/*
@@
-38,8
+38,6
@@
#include <sys/socket.h> /* socket library */
#include <stdio.h> /* include standard I/O library */
#include <sys/socket.h> /* socket library */
#include <stdio.h> /* include standard I/O library */
-#include "wrappers.h"
-
#define MAXLINE 256
void usage(void);
void ClientEcho(FILE * filein, int socket);
#define MAXLINE 256
void usage(void);
void ClientEcho(FILE * filein, int socket);
@@
-101,7
+99,7
@@
int main(int argc, char *argv[])
return -1;
}
/* read daytime from server */
return -1;
}
/* read daytime from server */
-
EchoClient
(stdin, sock_fd);
+
ClientEcho
(stdin, sock_fd);
/* normal exit */
return 0;
}
/* normal exit */
return 0;
}
@@
-122,8
+120,8
@@
void ClientEcho(FILE * filein, int socket)
char sendbuff[MAXLINE], recvbuff[MAXLINE];
int nread;
while (fgets(sendbuff, MAXLINE, filein) != NULL) {
char sendbuff[MAXLINE], recvbuff[MAXLINE];
int nread;
while (fgets(sendbuff, MAXLINE, filein) != NULL) {
-
Sock
Write(socket, sendbuff, strlen(sendbuff));
- nread =
Sock
Read(socket, recvbuff, strlen(sendbuff));
+
Full
Write(socket, sendbuff, strlen(sendbuff));
+ nread =
Full
Read(socket, recvbuff, strlen(sendbuff));
recvbuff[nread] = 0;
fputs(recvbuff, stdout);
}
recvbuff[nread] = 0;
fputs(recvbuff, stdout);
}