From c9b0771b8052039106ccf6346b8d39c8a8167622 Mon Sep 17 00:00:00 2001 From: sotech117 Date: Sat, 23 Sep 2023 21:55:05 +0000 Subject: print command line prompt after welcome is received --- client.c | 9 +++------ snowcast_control | Bin 18592 -> 14416 bytes 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/client.c b/client.c index fe6695d..06d7024 100644 --- a/client.c +++ b/client.c @@ -87,13 +87,11 @@ int main(int argc, char *argv[]) freeaddrinfo(servinfo); // all done with this structure + // sleep(1); + pthread_t reply_thread; pthread_create(&reply_thread, NULL, reply_thread_routine, (void*)sockfd); - usleep(1000); - - // sleep(1); - struct Hello hello; hello.commandType = 0; // convert updPort to an int @@ -107,8 +105,6 @@ int main(int argc, char *argv[]) // CONSIDER: could recieve the welcome message here char input[LINE_MAX]; - printf("Enter a number to change to it's station. Click q to end stream.\n"); - fflush(stdout); while (1) { char *line = fgets(input, LINE_MAX, stdin); @@ -160,6 +156,7 @@ void *reply_thread_routine(void* args) { } num_stations = ntohs(num_stations); printf("Welcome to Snowcast! The server has %d stations.\n", num_stations); + printf("Enter a number to change to it's station. Click q to end stream.\n"); continue; } diff --git a/snowcast_control b/snowcast_control index 48df5df..2ea8f55 100755 Binary files a/snowcast_control and b/snowcast_control differ -- cgit v1.2.3-70-g09d2