Using the select Subroutine on the Server Side
The select subroutine checks the specified file descriptors and message queues to see if they are ready for reading (receiving) or writing (sending), or if they have an exceptional condition pending. A select procedure allows the server to interrupt an activity, check for data, and then continue processing the activity.
For example, if the server processes RPC requests while performing another activity that involves periodically updating a data structure, the process can set an alarm signal to notify the server before calling the svc_run routine. However, if the current activity is waiting on a file descriptor, the call to the svc_run routine does not work. See Using the select Subroutine Example for more information.
A programmer can bypass the svc_run routine and call the svc_getreqset routine directly. It is necessary to know the file descriptors of the sockets associated with the programs being waited on. The programmer can have a select statement that waits on both the RPC socket and specified descriptors.