aboutsummaryrefslogtreecommitdiff
path: root/client.c
diff options
context:
space:
mode:
authorsotech117 <michael_foiani@brown.edu>2023-09-20 01:19:39 -0400
committersotech117 <michael_foiani@brown.edu>2023-09-20 01:19:39 -0400
commitea7aff51be44884e22c8bdabef917c77c291951e (patch)
tree7ecb12326287eb9c3799b047c36e555b5ccfbbaf /client.c
parent1263cbdbb6cf3ebbb157286b2bb2e488e4b931c8 (diff)
add better command line interface to server repl. also, add the print function that can go to file.
Diffstat (limited to 'client.c')
-rw-r--r--client.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/client.c b/client.c
index a989919..df5ea9b 100644
--- a/client.c
+++ b/client.c
@@ -144,9 +144,9 @@ void *reply_thread_routine(void* args) {
exit(1);
}
buf[recvbytes] = '\0';
- printf("client: received %d bytes on a reply call \n", recvbytes);
+ // printf("client: received %d bytes on a reply call \n", recvbytes);
// print the two first field of the call
- printf("client: replyType: %d, stringSize: %d\n", buf[0], buf[1]);
+ // printf("client: replyType: %d, stringSize: %d\n", buf[0], buf[1]);
// print the while buffer by char
for (int i = 0; i < recvbytes; i++) {
printf("%c ", buf[i]);
@@ -155,8 +155,8 @@ void *reply_thread_routine(void* args) {
memcpy(&reply, buf, 2);
// print out the fields of reply on one line
- printf("\nclient: replyType: %d, stringSize: %d\n", reply.replyType, reply.stringSize);
-
+ // printf("\nclient: replyType: %d, stringSize: %d\n", reply.replyType, reply.stringSize);
+
if (reply.replyType == 2) {
struct Welcome msg;
// recv the message, check for errors too
@@ -167,13 +167,13 @@ void *reply_thread_routine(void* args) {
// print the size of reply
if (reply.replyType == 3) {
- printf("client: received an announce message\n");
+ // printf("client: received an announce message\n");
char *song_name = malloc(reply.stringSize);
// printf(sizeof(struct Reply));
memcpy(song_name, buf + 2, reply.stringSize);
- printf("client: song name: %s\n", song_name);
+ printf("New song announced: %s\n", song_name);
free(song_name);