diff options
author | sotech117 <michael_foiani@brown.edu> | 2023-09-23 23:13:35 -0400 |
---|---|---|
committer | sotech117 <michael_foiani@brown.edu> | 2023-09-23 23:13:35 -0400 |
commit | 9625efcaf8e7d7f57c8d2678b4d68b85dae91980 (patch) | |
tree | d9bf39096228491775edb69fdd0c20e7a6361f8e /client.c | |
parent | c055294629f1c3bb8843c65ce5ebff15efc94b7b (diff) |
cleanup
Diffstat (limited to 'client.c')
-rw-r--r-- | client.c | 11 |
1 files changed, 4 insertions, 7 deletions
@@ -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"); |