listen performs functions common to all port monitors:
Each listen service may have a transport address in addition to its service code (svctag). This private address is included in the port monitor's administrative file. The inclusion of private addresses for services allows a single listen process to monitor multiple addresses. This functionality might be useful for purposes such as balancing loads and making services, such as a name server, work more efficiently. The number of addresses on which the listener can listen is determined by the number of file descriptors available to the process.
By default, a new instance of a service is invoked for each connection. Beginning with UNIX System V Release 4, the listener has the ability to pass an incoming connection (file descriptor) to a standing server, eliminating the fork and exec overhead for each call (see nlsadmin(1M)). This feature is useful for server processes that need to maintain state information.
The listener supports services that use sockets as their interface to the transport provider. Socket-based services are registered with the listener in the same way TLI-based services are, using the SAF's administrative commands. listen supports STREAMS; sockets is implemented as a STREAMS module and a library.
A socket-based service:
Dynamic addressing is most useful with RPC. RPC transport addresses may be either specified or dynamically assigned. In either case, the listener tells rpcbind what the address is and monitors it for incoming connections.
In the case of a dynamically assigned address, listen asks the transport provider to select a transport address each time the listener begins listening on behalf of the service.
When service addresses are dynamically assigned, the assigned address is written to the listener's log file.