aboutsummaryrefslogtreecommitdiff
path: root/snowcast_server.c
diff options
context:
space:
mode:
authorsotech117 <michael_foiani@brown.edu>2023-09-15 01:20:36 -0400
committersotech117 <michael_foiani@brown.edu>2023-09-15 01:20:36 -0400
commit97b4913de92b150ca18690df1b41e62c856aab05 (patch)
tree24fd472d45615c7aae9370dc0abe6f66baea24d8 /snowcast_server.c
parentcbfafaabbd846e625796f275b2e843376385cc36 (diff)
cleanup the hello and welcome interactoin
Diffstat (limited to 'snowcast_server.c')
-rw-r--r--snowcast_server.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/snowcast_server.c b/snowcast_server.c
index f09bfcc..e8f9525 100644
--- a/snowcast_server.c
+++ b/snowcast_server.c
@@ -138,6 +138,7 @@ int main(int argc, char *argv[])
get_in_addr((struct sockaddr*)&remoteaddr),
remoteIP, INET6_ADDRSTRLEN),
newfd);
+
// send the welcome message to client
struct Welcome welcome;
welcome.replyType = 2;
@@ -160,8 +161,12 @@ int main(int argc, char *argv[])
FD_CLR(i, &master); // remove from master set
} else {
// we got some data from a client
+ if (command.commandType == 0) {
+ // hello message with udpPort
+ printf("udpPort (from Hello) for new connection is %d.\n", ntohs(command.number));
+ }
if (command.commandType == 1) {
- // update the station for the user
+ // setStation command for the user
printf("TODO: set station to %d\n", ntohs(command.number));
}
else {