HP-UX Reference (11i v3 07/02) - 3 Library Functions N-Z (vol 7)

r
rpc_clnt_create(3N) rpc_clnt_create(3N)
send and receive buffers with the parameters sendsz and recvsz; values of
0 choose suitable defaults.
This routine returns NULL if it fails.
void clnt_pcreateerror()
Print a message to standard error indicating why a client RPC handle could not be created. The mes-
sage is prepended with the string s and a colon, and appended with a newline.
CLIENT *clnt_raw_create()
This routine creates an RPC client handle for the remote program prognum and version versnum.
The transport used to pass messages to the service is a buffer within the process’ address space, so the
corresponding RPC server should live in the same address space (see
svc_raw_create()
in
rpc_svc_create(3N)). This allows simulation of RPC and measurement of RPC overheads, such as
round trip times, without any kernel or networking interference. This routine returns NULL if it
fails.
clnt_raw_create()
should be called after svc_raw_create()
.
char *clnt_spcreateerror()
Like clnt_pcreateerror()
, except that it returns a string instead of printing to the standard
error. A newline is not appended to the message in this case.
Warning: returns a pointer to a buffer that is overwritten on each call. In multithreaded applications,
this buffer is implemented as thread-specific data.
CLIENT *clnt_tli_create()
This routine creates an RPC client handle for the remote program prognum and version versnum.
The remote program is located at address svcaddr.Ifsvcaddr is NULL and it is connection-oriented,
it is assumed that the file descriptor is connected. For connectionless transports, if svcaddr is NULL,
RPC_UNKNOWNADDR error is set. fildes is a file descriptor which may be open, bound and connected.
If it is
RPC_ANYFD, it opens a file descriptor on the transport specified by netconf.Iffildes is
RPC_ANYFD and netconf is NULL, a RPC_UNKNOWNPROTO
error is set. If fildes is unbound, then it
will attempt to bind the descriptor. The user may specify the size of the buffers with the parameters
sendsz and recvsz; values of
0 choose suitable defaults. Depending upon the type of the transport
(connection-oriented or connectionless),
clnt_tli_create()
calls appropriate client creation rou-
tines. This routine returns NULL if it fails. The
clnt_pcreateerror()
routine can be used to
print the reason for failure. The remote
rpcbind service (see rpcbind(1M)) is not consulted for the
address of the remote service.
CLIENT *clnt_tp_create()
Like clnt_create() except clnt_tp_create()
tries only one transport specified through
netconf.
clnt_tp_create() creates a client handle for the program prognum, the version versnum, and
for the transport specified by netconf. Default options are set, which can be changed using
clnt_control() calls. The remote
rpcbind service on the host host is consulted for the address
of the remote service. This routine returns NULL if it fails. The
clnt_pcreateerror()
routine
can be used to print the reason for failure.
CLIENT *clnt_tp_create_timed()
Like clnt_tp_create()
except clnt_tp_create_timed() has the extra parameter timeout
which specifies the maximum time allowed for the creation attempt to succeed. In all other respects,
the
clnt_tp_create_timed() call behaves exactly like the clnt_tp_create()
call.
CLIENT *clnt_vc_create()
This routine creates an RPC client for the remote program prognum and version versnum; the client
uses a connection-oriented transport. The remote program is located at address svcaddr. The param-
eter fildes is an open and bound file descriptor. The user may specify the size of the send and receive
buffers with the parameters sendsz and recvsz ; values of
0 choose suitable defaults. This routine
returns NULL if it fails.
The address svcaddr should not be NULL and should point to the actual address of the remote pro-
gram. clnt_vc_create() does not consult the remote rpcbind service for this information.
struct rpc_createerr rpc_createerr;
A global variable whose value is set by any RPC client handle creation routine that fails. It is used by
the routine clnt_pcreateerror() to print the reason for the failure.
In multithreaded applications, rpc_createerr becomes a macro which enables each thread to
have its own rpc_createerr.
HP-UX 11i Version 3: February 2007 5 Hewlett-Packard Company 317