/* * This is sample code generated by rpcgen. * These are only templates and you can use them * as a guideline for developing your own functions. */ #include "add.h" void add_prog_1(char *host) { CLIENT *clnt; int *result_1; intpair add_1_arg; #ifndef DEBUG clnt = clnt_create (host, ADD_PROG, ADD_VERS, "udp"); if (clnt == NULL) { clnt_pcreateerror (host); exit (1); } #endif /* DEBUG */ //voy a inicializar los valores add_1_arg.a=123; add_1_arg.b=22; result_1 = add_1(&add_1_arg, clnt); if (result_1 == (int *) NULL) { clnt_perror (clnt, "call failed"); } //codigo agregado para ver el resultado else { printf("resultado = %d \n",*result_1); } #ifndef DEBUG clnt_destroy (clnt); #endif /* DEBUG */ } int main (int argc, char *argv[]) { char *host; if (argc < 2) { printf ("usage: %s server_host\n", argv[0]); exit (1); } host = argv[1]; add_prog_1 (host); exit (0); }