aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsotech117 <michael_foiani@brown.edu>2023-09-23 18:25:10 -0400
committersotech117 <michael_foiani@brown.edu>2023-09-23 18:25:10 -0400
commite3f603ff96fd434fd220459dab8d63c0516f4e54 (patch)
tree8a690b70f36943d52a5b9d31c220894952cacdb5
parent60dc1dabef820bac6917d773e8ab2ea157e895c8 (diff)
revert to old clinet
-rw-r--r--client.c13
-rwxr-xr-xsnowcast_controlbin14376 -> 34893 bytes
-rwxr-xr-xsnowcast_listenerbin13656 -> 34270 bytes
-rwxr-xr-xsnowcast_serverbin28720 -> 54188 bytes
4 files changed, 8 insertions, 5 deletions
diff --git a/client.c b/client.c
index 5d98dd6..81342b6 100644
--- a/client.c
+++ b/client.c
@@ -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
index 9499ab7..e3d29cd 100755
--- a/snowcast_control
+++ b/snowcast_control
Binary files differ
diff --git a/snowcast_listener b/snowcast_listener
index f27a5c1..d15c2ac 100755
--- a/snowcast_listener
+++ b/snowcast_listener
Binary files differ
diff --git a/snowcast_server b/snowcast_server
index 7516d88..51f53e7 100755
--- a/snowcast_server
+++ b/snowcast_server
Binary files differ