/* * ClientSideProc.c */ #include /* for memset */ #include "square.h" #include #include #include #include #include #include #include int main(int argc, char **argv) { CLIENT *cl; struct square_in in; struct square_out out; if (argc != 3) { printf("Usage : client \n"); exit(1); } cl = clnt_create(argv[1], SQUARE_PROG, SQUARE_VERS, "tcp"); if (cl == NULL) { clnt_perror(cl, "call failed"); exit(1); } in.arg1 = atol(argv[2]); if (squareproc_2(&in, &out, cl) != RPC_SUCCESS) { printf("%s\n", clnt_perror(cl, argv[1])); exit(1); } printf("result: %ld\n", out.res1); exit(0); }