rpc_server_listen(3rpc)Tells the RPC runtime to listen for remote procedure calls Used by server applications. Synopsis #include <dce/rpc.h> void rpc_server_listen( unsigned32 max_calls_exec, unsigned32 *status); Parameters Input
max_calls_exec Use the value rpc_c_listen_max_calls_default to specify the default value. Also, the five rpc_server_use_*protseq* routines limit (according to their max_call_requests parameter) the number of concurrent remote procedure call requests that a server can accept. Output
status
Description · Sufficient network resources must be available to accept simultaneous call requests arriving over a particular protocol sequence. The value of max_call_requests in the five rpc_server_use_*protseq* routines advises the RPC runtime about the runtime's request of network resources. · Enough call threads must be available to execute the simultaneous call requests once they have been accepted. The value of max_calls_exec in rpc_server_listen( ) specifies the number of call threads. These conditions are independent of each other. A server application that specifies a value for max_calls_exec greater than 1 is responsible for concurrency control among the remote procedures since each executes in a separate thread. If the server receives more remote procedure calls than it can execute (more calls than the value of max_calls_exec), the RPC runtime accepts and queues additional remote procedure calls until a call execution thread is available. From the client's perspective, a queued remote procedure call appears the same as one that the server is actively executing. A client call remains blocked and in the queue until any one of the following events occurs: · The remote procedure call is assigned to an available call execution thread and the call runs to completion. · The client no longer can communicate with the server. · The client thread is canceled and the remote procedure call does not complete within the cancel time-out limits. The implementation of the RPC architecture determines the amount of queuing it provides. The RPC runtime continues listening for remote procedure calls (that is, the routine does not return to the server) until one of the following events occurs: · One of the server application's manager routines calls rpc_mgmt_stop_server_listening( ). · A client is allowed to, and makes, a remote rpc_mgmt_stop_server_listening( ) call to the server. On receiving a request to stop listening, the RPC runtime stops accepting new remote procedure calls for all registered interfaces. Executing calls and existing queued calls are allowed to complete. After all calls complete, rpc_server_listen( ) returns to the caller, which is a server application. For more information about a server's listening for and handling incoming remote procedure calls, refer to the OSF DCE Application Development Guide - Core Components. It also contains information about canceled threads.
Return Values Errors The following describes a partial list of errors that might be returned. Refer to the OSF DCE Problem Determination Guide for complete descriptions of all error messages.
rpc_s_ok
rpc_s_already_listening
rpc_s_max_calls_too_small
rpc_s_no_protseqs_registered
Related Information rpc_server_use_all_protseqs(3rpc) rpc_server_use_all_protseqs_if(3rpc) rpc_server_use_protseq_ep(3rpc) rpc_server_use_protseq_if(3rpc) Books: OSF DCE Application Development Guide - Core Components
|