From 3a9447c76c9731c82e92deb7aa589043614bdf39 Mon Sep 17 00:00:00 2001 From: sotech117 Date: Thu, 14 Sep 2023 19:18:27 -0400 Subject: cleanup files --- client.c | 34 ++-------------------------------- 1 file changed, 2 insertions(+), 32 deletions(-) (limited to 'client.c') 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; -- cgit v1.2.3-70-g09d2