HP-UX Reference (11i v1 05/09) - 3 Library Functions N-Z (vol 7)
r
rpc_svc_calls(3N) rpc_svc_calls(3N)
NAME
rpc_svc_calls, svc_dg_enablecache, svc_done, svc_exit, svc_fdset, svc_freeargs, svc_getargs,
svc_getreq_common, svc_getreq_poll, svc_getreqset, svc_getrpccaller, svc_pollset, svc_run, svc_sendreply -
library routines for RPC servers
SYNOPSIS
#include <rpc/rpc.h>
int svc_dg_enablecache(SVCXPRT *
xprt, const unsigned long cache_size);
int svc_done(SVCXPRT *
xprt);
void svc_exit(void);
fd_set svc_fdset;
bool_t svc_freeargs(const SVCXPRT *
xprt, const xdrproc_t
inproc,
caddr_t
in);
bool_t svc_getargs(const SVCXPRT *
xprt, const xdrproc_t inproc
, caddr_t in);
void svc_getreq_common(const int
fd);
void svc_getreq_poll(struct pollfd *
pfdp, const int pollretval);
void svc_getreqset(fd_set *
rdfds);
struct netbuf *svc_getrpccaller(const SVCXPRT *
xprt);
void svc_run(void);
bool_t svc_sendreply(const SVCXPRT *
xprt, const xdrproc_t outproc,
const caddr_t
out);
DESCRIPTION
These routines are part of the RPC library which allows C language programs to make procedure calls on
other machines across the network.
These routines are associated with the server side of the RPC mechanism. Some of them are called by the
server side dispatch function, while others (such as svc_run()) are called when the server is initiated.
The HP-UX implementation of RPC only supports the X/Open Transport Interface (XTI). Applications that
are written using the Transport Layer Interface (TLI) and wish to use RPC, must convert their application
to XTI.
Multithread Considerations
In the current implementation, the service transport handle
SVCXPRT contains a single data area for
decoding arguments and encoding results. Therefore, this structure cannot be freely shared between
threads that call functions that do this. However, when a server is operating in the User MT modes, a copy
of this structure is passed to the service dispatch procedure in order to enable concurrent request process-
ing. Under these circumstances, some routines which would otherwise be unsafe, become safe. These are
marked as such. Also marked are routines that are unsafe for MT applications, and are not to be used by
such applications.
Routines
See rpc(3N) for the definition of the
SVCXPRT data structure.
int svc_dg_enablecache()
This function allocates a duplicate request cache for the service endpoint xprt, large enough to hold
cache_size entries. Once enabled, there is no way to disable caching. This routine returns 1 if space
necessary for a cache of the given size was successfully allocated, and 0 otherwise.
This function is safe in MT applications.
int svc_done()
This function frees resources allocated to service a client request directed to the service endpoint xprt.
This call pertains only to servers executing in the User MT mode. In the User MT mode, service pro-
cedures must invoke this call before returning, either after a client request has been serviced, or after
an error or abnormal condition that prevents a reply from being sent. After svc_done() is invoked,
the service endpoint xprt should not be referenced by the service procedure. Server multithreading
modes and parameters can be set using the rpc_control () call.
HP-UX 11i Version 1: September 2005 − 1 − Hewlett-Packard Company Section 3−−837