/* * CS360: * Jim Plank */ #include #include "socketfun.h" main(int argc, char **argv) { int sock, fd; if (argc != 3) { fprintf(stderr, "usage: cat_server host port\n"); exit(1); } sock = serve_socket(argv[1], atoi(argv[2])); fd = accept_connection(sock); printf("Got a connection\n"); dup2(fd, 0); dup2(fd, 1); close(fd); close(sock); execlp("simpcat", "simpcat", NULL); }