HP-UX Reference (11i v1 05/09) - 3 Library Functions N-Z (vol 7)

r
rpc_svc_create(3N) rpc_svc_create(3N)
SVCSET_CONNMAXREC
Set the maximum record size, in bytes, for RPC requests and enable non-
blocking mode for this service handle. The value can be set and read for
both connection and connectionless-oriented transports, but it is silently
ignored for the connectionless-oriented case. info is a pointer to an argu-
ment of type
int. If the value pointed to by info is
-1 , then the maximum
record size is set to
RPC_MAXDATASIZE
.
SVCGET_CONNMAXREC
Get the maximum RPC request record size for this service handle. Zero
means no maximum is in effect, and the connection is in blocking mode. The
result is not significant for connectionless-oriented transports. info is a
pointer to an argument of type
int
.
int svc_create()
svc_create()
creates server handles for all the transports belonging to the class nettype.
nettype defines a class of transports that can be used for a particular application. The transports are
tried in left to right order in the
NETPATH variable or in top to bottom order in the netconfig
database. If nettype is NULL, it defaults to netpath.
svc_create() registers itself with the rpcbind service (see rpcbind(1M)). dispatch is called
when there is a remote procedure call for the given prognum and versnum; this requires calling
svc_run() (see svc_run() in rpc_svc_reg (3N)). If svc_create() succeeds, it returns the
number of server handles it created; otherwise, it returns 0 and an error message is logged.
void svc_destroy()
A function macro that destroys the RPC service handle xprt. Destruction usually involves deallocation
of private data structures, including xprt itself. Use of xprt is undefined after calling this routine.
SVCXPRT *svc_dg_create()
This routine creates a connectionless RPC service handle, and returns a pointer to it. This routine
returns NULL if it fails, and an error message is logged. sendsz and recvsz are parameters used to
specify the size of the buffers. If they are
0, suitable defaults are chosen. The file descriptor fildes
should be open and bound. The server is not registered with rpcbind(1M).
WARNING: Since connectionless-based RPC messages can only hold limited amount of encoded data,
this transport cannot be used for procedures that take large arguments or return huge results.
SVCXPRT *svc_fd_create()
This routine creates a service on top of an open and bound file descriptor, and returns the handle to it.
Typically, this descriptor is a connected file descriptor for a connection-oriented transport. sendsz and
recvsz indicate sizes for the send and receive buffers. If they are
0, reasonable defaults are chosen.
This routine returns
NULL if it fails, and an error message is logged.
SVCXPRT *svc_raw_create(void)
This routine creates an RPC service handle and returns a pointer to it. The transport is really a
buffer within the process’s address space, so the corresponding RPC client should live in the same
address space; (see clnt_raw_create()
in rpc_clnt_create(3N)). This routine allows simulation
of RPC and acquisition of RPC overheads (such as round trip times), without any kernel and network-
ing interference. This routine returns
NULL if it fails, and an error message is logged.
Note: svc_run() should not be called when the raw interface is being used.
SVCXPRT *svc_tli_create()
This routine creates an RPC server handle, and returns a pointer to it. fildes is the file descriptor on
which the service is listening. If fildes is RPC_ANYFD, it opens a file descriptor on the transport
specified by netconf. If the file descriptor is unbound and bindaddr is non-null fildes is bound to the
address specified by bindaddr, otherwise fildes is bound to a default address chosen by the transport.
In the case where the default address is chosen, the number of outstanding connect requests is set to 8
for connection-oriented transports. 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, and an error message is logged. The server is not registered with the rpcbind(1M) service.
SVCXPRT *svc_tp_create()
svc_tp_create()
creates a server handle for the network specified by netconf, and registers itself
with the rpcbind service. dispatch is called when there is a remote procedure call for the given
prognum and versnum; this requires calling svc_run(). svc_tp_create() returns the service
HP-UX 11i Version 1: September 2005 2 Hewlett-Packard Company Section 3841