aboutsummaryrefslogtreecommitdiff
path: root/client.c
diff options
context:
space:
mode:
authorsotech117 <michael_foiani@brown.edu>2023-09-14 19:18:27 -0400
committersotech117 <michael_foiani@brown.edu>2023-09-14 19:18:27 -0400
commit3a9447c76c9731c82e92deb7aa589043614bdf39 (patch)
tree022f7b338f9170c5b61efff18022eca0e25384f5 /client.c
parent663580b36a1b2590b7e706baa798e130297e88ee (diff)
cleanup files
Diffstat (limited to 'client.c')
-rw-r--r--client.c34
1 files changed, 2 insertions, 32 deletions
diff --git a/client.c b/client.c
index adacafe..6458227 100644
--- a/client.c
+++ b/client.c
@@ -31,7 +31,7 @@ void *get_in_addr(struct sockaddr *sa)
int main(int argc, char *argv[])
{
int sockfd, numbytesrecv, numbytessent, recvbytes;
- char buf[MAXDATASIZE];
+ // char buf[MAXDATASIZE];
struct addrinfo hints, *servinfo, *p;
int rv;
char s[INET6_ADDRSTRLEN];
@@ -88,22 +88,8 @@ int main(int argc, char *argv[])
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);
- // close(sockfd);
-
- // if ((numbytesrecv = recv(sockfd, buf, MAXDATASIZE-1, 0)) == -1) {
- // perror("recv");
- // exit(1);
- // }
- // buf[numbytesrecv] = '\0';
-
- // printf("client: received '%s'\n",buf);
-
- // make a struct for the message, number is thennubmer of stations
+
struct Hello hello;
hello.commandType = 0;
// convert updPort to an int
@@ -114,22 +100,6 @@ int main(int argc, char *argv[])
perror("send");
exit(1);
}
-
- // make new struct for the incoming message
- // buf[numbytesrecv] = '\0';
- // char bufff[MAXDATASIZE];
- // if ((recvbytes = recv(sockfd, bufff, MAXDATASIZE, 0)) == -1)
- // {
- // perror("recv");
- // exit(1);
- // }
- // bufff[recvbytes] = '\0';
-
- // // print the num bytes received
- // printf("client: received '%d'\n", recvbytes);
-
- // //printf("Welcome to Snowcast! The server has %d stations.\n", ntohl(msg.number));
- // printf("%s", bufff);
close(sockfd);
return 0;