From 9625efcaf8e7d7f57c8d2678b4d68b85dae91980 Mon Sep 17 00:00:00 2001 From: sotech117 Date: Sat, 23 Sep 2023 23:13:35 -0400 Subject: cleanup --- client.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'client.c') diff --git a/client.c b/client.c index 63f7ef2..288b50c 100644 --- a/client.c +++ b/client.c @@ -138,16 +138,14 @@ int main(int argc, char *argv[]) } - printf("reply_type: %d\n", reply_type); - - if (reply_type == 2) { // we have a welcome message + if (reply_type == 2) { // we have a second welcome message close(sockfd); exit(1); } if (reply_type == 3) { // we have an announce message if (!station_is_set) { - fprintf(stderr, "ANNOUNCE received whem station not set."); + fprintf(stderr, "ANNOUNCE received before SETSTATION command."); close(sockfd); exit(1); } @@ -167,7 +165,6 @@ int main(int argc, char *argv[]) exit(1); } remove_timeout(sockfd); - // remove_timeout(sockfd); fflush(stdout); printf("New song announced: %s\n", song_name); fflush(stdout); @@ -208,7 +205,7 @@ int main(int argc, char *argv[]) perror("recv_all"); exit(1); } - // remove_timeout(sockfd); + remove_timeout(sockfd); fflush(stdout); printf("Station Information:\n%s\n", info); fflush(stdout); @@ -246,7 +243,7 @@ void *command_line_routine(void* args) { exit(0); } else if (strncmp("l\n", input, LINE_MAX) == 0) { // send the command to list stations - // apply_timeout(sockfd); + apply_timeout(sockfd); int list_station_reply_type = 5; if (send(sockfd, &list_station_reply_type, 1, 0) == -1) { perror("send"); -- cgit v1.2.3-70-g09d2