/* * The bulk of this was generated automatically by rpcgen -a * The -a paramter causes rpcgen to generate the framework for * the all of the components, including the server and client * * I marked the remote procedure call itself, and a line I added * to print the results, with my initials: GMK */ #include "helloworld.h" void helloworldprog_1(char *host) { CLIENT *clnt; char * *result_1; char *helloworld_1_arg; #ifndef DEBUG clnt = clnt_create (host, HELLOWORLDPROG, HELLOWORLDVERS, "udp"); if (clnt == NULL) { clnt_pcreateerror (host); exit (1); } #endif /* DEBUG */ /* GMK: The remote procedure call, itself *. result_1 = helloworld_1((void*)&helloworld_1_arg, clnt); if (result_1 == (char **) NULL) { clnt_perror (clnt, "call failed"); } #ifndef DEBUG clnt_destroy (clnt); #endif /* DEBUG */ /* GMK: Printing out the results */ printf ("Got \"%s\" from the server.\n", *result_1); } int main (int argc, char *argv[]) { char *host; if (argc < 2) { printf ("usage: %s server_host\n", argv[0]); exit (1); } host = argv[1]; helloworldprog_1 (host); exit (0); }