diff options
author | sotech117 <michael_foiani@brown.edu> | 2023-09-14 19:16:23 -0400 |
---|---|---|
committer | sotech117 <michael_foiani@brown.edu> | 2023-09-14 19:16:23 -0400 |
commit | 663580b36a1b2590b7e706baa798e130297e88ee (patch) | |
tree | 3202db0b4e4b50c1d19390ae570ad0ef668cf077 /client.c | |
parent | bbfbcc6c936b16568d96619f02f8bb081c190b2a (diff) |
pass all tests on warmup
Diffstat (limited to 'client.c')
-rw-r--r-- | client.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -87,11 +87,12 @@ int main(int argc, char *argv[]) perror("recv"); exit(1); } + msg.numStations = ntohs(msg.numStations); // print the num bytes received // printf("client: received '%s'\n", msg); // printf("size of '%d'\n", recvbytes); printf("Welcome to Snowcast! The server has %d stations.\n", msg.numStations); - // printf("type %d", msg.replyType); + // printf("type %d", msg.replyType); // close(sockfd); // if ((numbytesrecv = recv(sockfd, buf, MAXDATASIZE-1, 0)) == -1) { @@ -107,7 +108,7 @@ int main(int argc, char *argv[]) hello.commandType = 0; // convert updPort to an int int udpPortInt = atoi(udpPort); - hello.udpPort = htonl(udpPortInt); + hello.udpPort = htons(udpPortInt); if ((numbytessent = send(sockfd, &hello, sizeof(struct Hello), 0)) == -1) { perror("send"); |