1rpc_control(3NSL)    Networking Services Library Functions   rpc_control(3NSL)
2
3
4

NAME

6       rpc_control  -  library  routine for manipulating global RPC attributes
7       for client and server applications
8

SYNOPSIS

10       bool_t rpc_control(int op, void *info);
11
12

DESCRIPTION

14       This RPC library routine allows applications to set and  modify  global
15       RPC  attributes  that apply to clients as well as servers.  At present,
16       it supports only server side operations. This function allows  applica‐
17       tions  to set and modify global attributes that apply to client as well
18       as server functions. op indicates the type of operation, and info is  a
19       pointer  to the operation specific information. The supported values of
20       op and their argument types, and what they do are:
21
22         RPC_SVC_MTMODE_SET       int *     set multithread mode
23         RPC_SVC_MTMODE_GET       int *     get multithread mode
24         RPC_SVC_THRMAX_SET       int *     set maximum number of threads
25         RPC_SVC_THRMAX_GET       int *     get maximum number of threads
26         RPC_SVC_THRTOTAL_GET     int *     get number of active threads
27         RPC_SVC_THRCREATES_GET   int *     get number of threads created
28         RPC_SVC_THRERRORS_GET    int *     get number of thread create errors
29         RPC_SVC_USE_POLLFD       int *     set number of file descriptors to unlimited
30         RPC_SVC_CONNMAXREC_SET   int *  set non-blocking max rec size
31         RPC_SVC_CONNMAXREC_GET   int *  get non-blocking max rec size
32
33
34
35       There are three multithread (MT) modes.  These are:
36
37         RPC_SVC_MT_NONE     Single threaded mode     (default)
38         RPC_SVC_MT_AUTO     Automatic MT mode
39         RPC_SVC_MT_USER     User MT mode
40
41
42
43       Unless the application sets the Automatic or User  MT  modes,  it  will
44       stay in the default (single threaded) mode.  See the Network Interfaces
45       Programmer's Guide for the meanings  of  these  modes  and  programming
46       examples.  Once a mode is set, it cannot be changed.
47
48
49       By  default,  the maximum number of threads that the server will create
50       at any time is 16.  This allows the service developer to put a bound on
51       thread  resources  consumed  by a server.  If a server needs to process
52       more than 16  client  requests  concurrently,  the  maximum  number  of
53       threads  must  be set to the desired number.  This parameter may be set
54       at any time by the server.
55
56
57       Set and get operations will succeed even in modes where the  operations
58       don't apply.  For example, you can set the maximum number of threads in
59       any mode, even though it makes sense only for the  Automatic  MT  mode.
60       All  of  the get operations except RPC_SVC_MTMODE_GET apply only to the
61       Automatic MT mode, so values returned in other modes may be undefined.
62
63
64       By default, RPC servers are limited to a maximum of 1024 file  descrip‐
65       tors  or  connections  due  to limitations in the historical interfaces
66       svc_fdset(3NSL) and svc_getreqset(3NSL). Applications  written  to  use
67       the preferred interfaces of svc_pollfd(3NSL) and  svc_getreq_poll(3NSL)
68       can use an unlimited number of file descriptors. Setting info to  point
69       to a non-zero integer and  op to RPC_SVC_USE_POLLFD removes the limita‐
70       tion.
71
72
73       Connection oriented RPC transports read RPC requests in  blocking  mode
74       by  default. Thus, they may be adversely affected by network delays and
75       broken clients. RPC_SVC_CONNMAXREC_SET enables  non-blocking  mode  and
76       establishes  the  maximum  record size (in bytes) for RPC requests; RPC
77       responses are not affected. Buffer space is allocated as needed  up  to
78       the  specified  maximum,  starting  at  the maximum or RPC_MAXDATASIZE,
79       whichever is smaller.
80
81
82       The value established by RPC_SVC_CONNMAXREC_SET is used when a  connec‐
83       tion  is created, and it remains in effect for that connection until it
84       is closed. To change the value for existing connections on  a  per-con‐
85       nection basis, see svc_control(3NSL).
86
87
88       RPC_SVC_CONNMAXREC_GET  retrieves  the  current  maximum record size. A
89       zero value means that no maximum is in effect, and that the connections
90       are in blocking mode.
91
92
93       info is a pointer to an argument of type int. Non-connection RPC trans‐
94       ports ignore RPC_SVC_CONNMAXREC_SET and RPC_SVC_CONNMAXREC_GET.
95

RETURN VALUES

97       This routine returns TRUE if the operation was successful and  returns‐
98       FALSE otherwise.
99

ATTRIBUTES

101       See attributes(5) for descriptions of the following attributes:
102
103
104
105
106       ┌─────────────────────────────┬─────────────────────────────┐
107       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
108       ├─────────────────────────────┼─────────────────────────────┤
109       │MT-Level                     │MT-Safe                      │
110       └─────────────────────────────┴─────────────────────────────┘
111

SEE ALSO

113       rpcbind(1M), rpc(3NSL), rpc_svc_calls(3NSL), attributes(5)
114
115
116       Network Interfaces Programmer's Guide
117
118
119
120SunOS 5.11                        24 Feb 1999                rpc_control(3NSL)
Impressum