HP-UX Reference (11i v2 03/08) - 3 Library Functions N-Z (vol 7)

r
rpc_clnt_calls(3N) rpc_clnt_calls(3N)
bool_t clnt_freeres()
A function macro that frees any data allocated by the RPC/XDR system when it decoded the results
of an RPC call. The parameter out is the address of the results, and outproc is the XDR routine
describing the results. This routine returns
1 if the results were successfully freed, and
0 other-
wise.
void clnt_geterr()
A function macro that copies the error structure out of the client handle to the structure at address
errp.
void clnt_perrno()
Print a message to standard error corresponding to the condition indicated by stat. A newline is
appended. Normally used after a procedure call fails for a routine for which a client handle is not
needed, for instance
rpc_call().
void clnt_perror()
Print a message to the standard error indicating why an RPC call failed; clnt is the handle used to
do the call. The message is prepended with string s and a colon. A newline is appended. Normally
used after a remote procedure call fails for a routine which requires a client handle, for instance
clnt_call().
char *clnt_sperrno()
Take the same arguments as clnt_perrno()
, but instead of sending a message to the standard
error indicating why an RPC call failed, return a pointer to a string which contains the message.
clnt_sperrno() is normally used instead of
clnt_perrno() when the program does not have
a standard error (as a program running as a server quite likely does not), or if the programmer does
not want the message to be output with
printf() (see printf (3S)), or if a message format different
than that supported by clnt_perrno()
is to be used.
Note: unlike
clnt_sperror() and
clnt_spcreaterror() (see rpc_clnt_create(3N)),
clnt_sperrno() does not return pointer to static data so the result will not get overwritten on
each call.
char *clnt_sperror()
Like clnt_perror(), except that (like
clnt_sperrno()) it returns a string instead of printing
to standard error. However,
clnt_sperror()
does not append a newline at the end of the mes-
sage.
Warning: returns pointer to a buffer that is overwritten on each call. In multithread applications,
this buffer is implemented as thread-specific data.
enum clnt_stat rpc_broadcast()
Like rpc_call(), except the call message is broadcast to all the connectionless transports
specified by nettype .Ifnettype is NULL, it defaults to netpath. Each time it receives a response,
this routine calls eachresult(), whose form is:
bool_t eachresult(caddr_t out,const struct netbuf *addr,
const struct netconfig *netconf);
where out is the same as out passed to rpc_broadcast(), except that the remote procedure’s out-
put is decoded there; addr points to the address of the machine that sent the results, and netconf is
the netconfig structure of the transport on which the remote server responded. If eachresult()
returns 0, rpc_broadcast() waits for more replies; otherwise it returns with appropriate status.
Warning: broadcast file descriptors are limited in size to the maximum transfer size of that tran-
sport. For Ethernet, this value is 1500 bytes.
rpc_broadcast() uses AUTH_SYS credentials by
default (see rpc_clnt_auth(3N)).
enum clnt_stat rpc_broadcast_exp()
Like rpc_broadcast(), except that the initial timeout, inittime and the maximum timeout, wait-
time are specified in milliseconds.
inittime is the initial time that
rpc_broadcast_exp() waits before resending the request. After
the first resend, the re-transmission interval increases exponentially until it exceeds waittime .
enum clnt_stat rpc_call()
Call the remote procedure associated with prognum, versnum, and procnum on the machine, host.
The parameter inproc is used to encode the procedure’s parameters, and outproc is used to decode
HP-UX 11i Version 2: August 2003 2 Hewlett-Packard Company Section 3887