rpc_svc_create.3n (2010 09)
r
rpc_svc_create(3N) rpc_svc_create(3N)
is, an RPC_PROGVERSMISMATCH
error will be returned);
1 indicates
that the out of range request will be silently ignored.
SVCSET_VERSQUIET
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
RPC_PROGVERSMISMATCH
error will normally be returned. It is some-
times desirable to change this behavior. info should be a pointer to an
integer which is either
0 (indicating normal server behavior and an
RPC_PROGVERSMISMATCH
error will be returned), or
1 (indicating that
the out of range request should be silently ignored).
SVCGET_XID Returns the transaction ID of connection-oriented and connectionless
transport service calls. The transaction ID assists in uniquely identify-
ing client requests for a given RPC version, program number, procedure,
and client. The transaction ID is extracted from the service transport
handle svc . info must be a pointer to an unsigned long. Upon successful
completion of the
SVCGET_XID request, *info contains the transaction
ID. Note that rendezvous and raw service handles do not define a tran-
saction ID. Thus, if the service handle is of rendezvous or raw type, and
the request is of type SVCGET_XID, svc_control()
will return
FALSE. Note also that the transaction ID read by the server can be set
by the client through the suboption CLSET_XID in clnt_control()
.
(See clnt_create (3N)).
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 transports. info is a
pointer to an argument of type
int.
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-oriented and connectionless transports, but it is
silently ignored for the connectionless case. info is a pointer to an argu-
ment of type
int. If the value pointed to by info is -1, then the max-
imum record size is set to RPC_MAXDATASIZE
.
This routine returns
TRUE if the operation was successful. Otherwise, it returns FALSE.
int svc_create()
svc_create() 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
NETPATH variable or in top to bottom order in the netconfig data-
base. 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 dealloca-
tion of private data structures, including xprt itself. Use of xprt is undefined after calling this rou-
tine.
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
2 Hewlett-Packard Company − 2 − HP-UX 11i Version 3: September 2010