/** * client.c, copyright 2001 Steve Gribble * * The client is a single-threaded program; it sits in a tight * loop, and in each iteration, it opens a TCP connection to * the server, sends a request, and reads back a response. */ #include #include #include #include #include #include "SocketLibrary/socklib.h" #include "common.h" /** * This program should be invoked as "./client hostname portnumber", * for example, "./client spinlock 4342". */ int main(int argc, char **argv) { int socket_talk, i; char request[REQUEST_SIZE]; char response[RESPONSE_SIZE]; if (argc != 3) { fprintf(stderr, "(CLIENT): Invoke as 'client machine.name.address socknum'\n"); exit(1); } // initialize request to some silly data for (i=0; i