aboutsummaryrefslogtreecommitdiff
path: root/client.c
diff options
context:
space:
mode:
Diffstat (limited to 'client.c')
-rw-r--r--client.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/client.c b/client.c
index 11c462f..adacafe 100644
--- a/client.c
+++ b/client.c
@@ -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");