The callrpc() call calls remote procedures.
Syntax
#include <rpc\rpc.h> enum clnt_stat callrpc(host, prognum, versnum, procnum, inproc, in, outproc, out) char *host; u_long prognum; u_long versnum; u_long procnum; xdrproc_t inproc; char *in; xdrproc_t outproc; char *out;
Parameters
host
Description
The callrpc() call calls the remote procedure described by prognum, versnum, and procnum running on the host system. It encodes and decodes the parameters for transfer.
Notes:
Return Values
RPC_SUCCESS indicates success; otherwise, an error has occurred. The results of the remote procedure call return to out.
Examples
#define RMTPROGNUM (u_long)0x3fffffffL#define RMTPROGVER (u_long)0x1 #define RMTPROCNUM (u_long)0x1 int inproc=100, outproc, rstat; ... /* service request to host RPCSERVER_HOST */ if (rstat = callrpc("RPCSERVER_HOST", RMTPROGNUM, RMTPROGVER, RMTPROCNUM, xdr_int, (char *)&inproc, xdr_int, (char *)&outproc)!= 0) { clnt_perrno(rstat); exit(1); } ...
Related Calls