rpc_svc_create(3N)rpc_svc_create(3N)NAME
rpc_svc_create: svc_control(), svc_create(), svc_destroy(), svc_dg_cre‐
ate(), svc_fd_create(), svc_raw_create(), svc_tli_create(), svc_tp_cre‐
ate(), svc_vc_create() - library routines for the creation of server
handles
SYNOPSISDESCRIPTION
These routines are part of the RPC library which allows C language pro‐
grams to make procedure calls on servers across the network. These
routines deal with the creation of service handles. Once the handle is
created, the server can be invoked by calling
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 applica‐
tion to XTI.
Routines
See rpc(3N) for the definition of the data structure.
A function to change or retrieve various information
about a service object. req indicates the type of operation and
info is a pointer to the information. The supported values of
req, their argument types, and what they do are:
If a request is received for a program number served by this
server but the version number is outside the range registered
with the server, an error will normally be returned. info
should be a pointer to an integer. Upon successful completion
of the request, *info contains an integer which describes the
server's current behavior: indicates normal server behavior
(that is, an error will be returned); indicates that the out of
range request will be silently ignored.
If a request is received for a program number served by this
server
but the version number is outside the range registered
with the server, an error will normally be returned. It
is sometimes desirable to change this behavior. info
should be a pointer to an integer which is either (indi‐
cating normal server behavior and an error will be
returned), or (indicating that the out of range request
should be silently ignored).
Returns the transaction ID of connection-oriented and connec‐
tionless
transport service calls. The transaction ID assists in
uniquely identifying client requests for a given RPC ver‐
sion, program number, procedure, and client. The trans‐
action ID is extracted from the service transport handle
svc. info must be a pointer to an unsigned long. Upon
successful completion of the request, *info contains the
transaction ID. Note that rendezvous and raw service
handles do not define a transaction ID. Thus, if the
service handle is of rendezvous or raw type, and the
request is of type will return Note also that the trans‐
action ID read by the server can be set by the client
through the suboption in (See clnt_create(3N)).
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 con‐
nectionless transports. info is a pointer to an argument
of type
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-oriented and connec‐
tionless transports, but it is silently ignored for the
connectionless case. info is a pointer to an argument of
type If the value pointed to by info is then the maximum
record size is set to
This routine returns if the operation was successful. Other‐
wise, it returns
creates server handles for all the transports belonging to the class
nettype.
nettype defines a class of transports which can be used for a
particular application. The transports are tried in left to
right order in variable or in top to bottom order in the netcon‐
fig database. If nettype is NULL, it defaults to
registers itself with the service (see rpcbind(1M)). dispatch
is called when there is a remote procedure call for the given
prognum and versnum; this requires calling (see in
rpc_svc_reg(3N)). If succeeds, it returns the number of server
handles it created, otherwise it returns and an error message is
logged.
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.
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 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.
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-ori‐
ented transport. sendsz and recvsz indicate sizes for the send
and receive buffers. If they are reasonable defaults are cho‐
sen. This routine returns NULL if it fails, and an error mes‐
sage is logged.
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 cor‐
responding RPC client should live in the same address space;
(see 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 networking interference. This routine
returns NULL if it fails, and an error message is logged.
Note: should not be called when the raw interface is being used.
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 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
choose suitable defaults. This routine returns NULL if it
fails, and an error message is logged. The server is not regis‐
tered with the rpcbind(1M) service.
creates a server handle for the network specified by
netconf, and registers itself with the service. dispatch is
called when there is a remote procedure call for the given
prognum and versnum; this requires calling returns the service
handle if it succeeds, otherwise a NULL is returned and an error
message is logged.
This routine creates a connection-oriented RPC
service and returns a pointer to it. This routine returns NULL
if it fails, and an error message is logged. The users may
specify the size of the send and receive buffers with the param‐
eters sendsz and recvsz; values of choose suitable defaults.
The file descriptor fildes should be open and bound. The server
is not registered with the rpcbind(1M) service.
MULTITHREAD USAGE
Thread Safe: Yes
Cancel Safe: Yes
Fork Safe: No
Async-cancel Safe: No
Async-signal Safe: No
These functions can be called safely in a multithreaded environment.
They may be cancellation points in that they call functions that are
cancel points.
In a multithreaded environment, these functions are not safe to be
called by a child process after and before These functions should not
be called by a multithreaded application that supports asynchronous
cancellation or asynchronous signals.
SEE ALSOrpcbind(1M), rpc(3N), rpc_svc_calls(3N), rpc_svc_err(3N),
rpc_svc_reg(3N).
rpc_svc_create(3N)