diff options
author | sotech117 <michael_foiani@brown.edu> | 2023-09-23 18:25:10 -0400 |
---|---|---|
committer | sotech117 <michael_foiani@brown.edu> | 2023-09-23 18:25:10 -0400 |
commit | e3f603ff96fd434fd220459dab8d63c0516f4e54 (patch) | |
tree | 8a690b70f36943d52a5b9d31c220894952cacdb5 | |
parent | 60dc1dabef820bac6917d773e8ab2ea157e895c8 (diff) |
revert to old clinet
-rw-r--r-- | client.c | 13 | ||||
-rwxr-xr-x | snowcast_control | bin | 14376 -> 34893 bytes | |||
-rwxr-xr-x | snowcast_listener | bin | 13656 -> 34270 bytes | |||
-rwxr-xr-x | snowcast_server | bin | 28720 -> 54188 bytes |
4 files changed, 8 insertions, 5 deletions
@@ -1,3 +1,4 @@ + /* ** client.c -- a stream socket client demo */ @@ -84,14 +85,15 @@ int main(int argc, char *argv[]) inet_ntop(p->ai_family, get_in_addr((struct sockaddr *)p->ai_addr), s, sizeof s); + // printf("client: connecting to %s\n", s); 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); + struct Hello hello; hello.commandType = 0; // convert updPort to an int @@ -104,7 +106,9 @@ 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"); while (1) { char *line = fgets(input, LINE_MAX, stdin); @@ -155,8 +159,7 @@ void *reply_thread_routine(void* args) { exit(1); } num_stations = ntohs(num_stations); - printf("The server has %u stations.\n", num_stations); - // printf("Enter a number to change to it's station. Click q to end stream.\n"); + printf("Welcome to Snowcast! The server has %d stations.\n", num_stations); continue; } @@ -198,7 +201,7 @@ void *reply_thread_routine(void* args) { exit(1); } - printf("Lost connection to server. Exiting.\n"); + printf("Lost connection to server. Exiting."); close(sockfd); exit(1); } diff --git a/snowcast_control b/snowcast_control Binary files differindex 9499ab7..e3d29cd 100755 --- a/snowcast_control +++ b/snowcast_control diff --git a/snowcast_listener b/snowcast_listener Binary files differindex f27a5c1..d15c2ac 100755 --- a/snowcast_listener +++ b/snowcast_listener diff --git a/snowcast_server b/snowcast_server Binary files differindex 7516d88..51f53e7 100755 --- a/snowcast_server +++ b/snowcast_server |