Port monitors such as inetd(ADMN) and listen(SSC) can monitor network addresses for specified RPC services. Whenever a request comes in for a particular service, the port monitor spawns a server process to provide for it. After the call has been serviced, the server can exit. This has the advantage of conserving system resources: fewer blocked processes waiting for work.
It may be useful for services to wait for a specified interval after satisfying a service request, on the chance that another request will follow. If there is no call within the specified time, the server will exit and some port monitors, like inetd, will continue to monitor for the server. If a later request for the service occurs, the port monitor will give the request to a waiting server process (if any), rather than spawning a new process.
By default, services
wait for 120 seconds after servicing a request before exiting.
The programmer can, however, change that interval with the
rpcgen -K 20 proto.x
The server will wait only for 20 seconds before exiting. To create a server that exits immediately, -K 0 can be used. To create a server that never exits (a standing server), the appropriate argument is -K -1.
All servers generated by rpcgen assume the following support from port monitors: