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

r
rpc_clnt_create(3N) rpc_clnt_create(3N)
is not used in this mode.
The following operations are valid for connectionless transports only:
CLSET_RETRY_TIMEOUT struct timeval * set the retry timeout
CLGET_RETRY_TIMEOUT struct timeval * get the retry timeout
The retry timeout is the time that RPC waits for the server to reply before retransmitting the request.
clnt_control()
returns TRUE on success and FALSE on failure.
CLIENT *clnt_create()
Generic client creation routine for program prognum and version versnum. host identifies the name
of the remote host where the server is located. nettype indicates the class of transport protocol to use.
The transports are tried in left to right order in
NETPATH variable or in top to bottom order in the
netconfig database.
clnt_create() tries all the transports of the nettype class available from the
NETPATH environ-
ment variable and the netconfig database, and chooses the first successful one. A default timeout is
set and can be modified using
clnt_control(). This routine returns NULL if it fails. The
clnt_pcreateerror()
routine can be used to print the reason for failure.
Note that
clnt_create() returns a valid client handle even if the particular version number sup-
plied to
clnt_create() is not registered with the
rpcbind service. This mismatch will be
discovered by a
clnt_call later (see rpc_clnt_calls(3N)).
CLIENT *clnt_create_timed()
Generic client creation routine which is similar to clnt_create()
but with the additional parame-
ter timeout, which specifies the maximum amount of time allowed for each transport class tried. In
all other respects, the
clnt_create_timed()
call behaves exactly like the clnt_create()
call.
CLIENT *clnt_create_vers()
Generic client creation routine which is similar to clnt_create()
but which also checks for the
version availability. host identifies the name of the remote host where the server is located. nettype
indicates the class transport protocols to be used. If the routine is successful it returns a client handle
created for the highest version between vers_low and vers_high that is supported by the server.
vers_outp is set to this value. That is, after a successful return vers_low <= *vers_outp <= vers_high.
If no version between vers_low and vers_high is supported by the server then the routine fails and
returns NULL. A default timeout is set and can be modified using
clnt_control()
. This routine
returns NULL if it fails. The
clnt_pcreateerror()
routine can be used to print the reason for
failure.
Note:
clnt_create() returns a valid client handle even if the particular version number supplied
to
clnt_create() is not registered with the
rpcbind service. This mismatch will be discovered
by a
clnt_call later (see rpc_clnt_calls(3N)). However,
clnt_create_vers() does this for
you and returns a valid handle only if a version within the range supplied is supported by the server.
CLIENT *clnt_create_vers_timed()
Generic client creation routine which is similar to clnt_create_vers()
but with the additional
parameter timeout, which specifies the maximum amount of time allowed for each transport class
tried. In all other respects, the
clnt_create_vers_timed() call behaves exactly like the
clnt_create_vers() call.
void clnt_destroy()
A function macro that destroys the client’s RPC handle. Destruction usually involves deallocation of
private data structures, including clnt itself. Use of clnt is undefined after calling
clnt_destroy(). If the RPC library opened the associated file descriptor, or CLSET_FD_CLOSE
was set using clnt_control(), the file descriptor will be closed.
The caller should call auth_destroy(clntcl_auth) (before calling clnt_destroy()
)to
destroy the associated AUTH structure (see rpc_clnt_auth(3N)).
CLIENT *clnt_dg_create()
This routine creates an RPC client for the remote program prognum and version versnum; the client
uses a connectionless transport. The remote program is located at address svcaddr. The parameter
fildes is an open and bound file descriptor. This routine will resend the call message in intervals of 15
seconds until a response is received or until the call times out. The total time for the call to time out
is specified by clnt_call() (see clnt_call() in rpc_clnt_calls(3N)). The retry timeout and the
total timeout periods can be changed using clnt_control(). The user may set the size of the
316 Hewlett-Packard Company 4 HP-UX 11i Version 3: February 2007