aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsotech117 <michael_foiani@brown.edu>2023-09-23 21:55:05 +0000
committersotech117 <michael_foiani@brown.edu>2023-09-23 21:55:05 +0000
commitc9b0771b8052039106ccf6346b8d39c8a8167622 (patch)
tree921b80a0f6cd18502ca0ae21bb592ecbf6a1bb7e
parent236b54df92a81f71db95e76141660a69fa1079e2 (diff)
print command line prompt after welcome is received
-rw-r--r--client.c9
-rwxr-xr-xsnowcast_controlbin18592 -> 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
--- a/snowcast_control
+++ b/snowcast_control
Binary files differ