#include #include #include #include #include #include #include // Usage: client name guess int main(int argc, char ** argv){ struct sockaddr_in address; address.sin_family = AF_INET; address.sin_port = htons(5130); address.sin_addr.s_addr = 0x0100007F; // To use: Put the address here that you want to connect to printf("Connecting to %s\n", inet_ntoa(address.sin_addr)); int fd = socket(AF_INET, SOCK_STREAM, 0); connect(fd, (struct sockaddr*)(&address), sizeof(address)); uint32_t guess = atoi(argv[2]); write(fd, argv[1], 16); write(fd, &guess, 4); uint8_t points; read(fd, &points, 1); printf("Score: %u points\n", points); return 0; }