PreviousNext

Listening for Incoming Service Requests

In order to begin listening for incoming remote procedure calls, the server calls the following RPC library routine:

rpc_server_listen(max_calls_exec, &status);

The max_calls_exec parameter specifies the number of concurrent remote procedure calls the server can execute. This call normally begins a "semi-infinite" loop, execution of which is terminated only by one of the following events:

· One of the server's manager routines calls rpc_mgmt_stop_server_listening( )

· One of the server's clients makes a remote call using the routine rpc_mgmt_stop_server_listening( ). (Note that the server can intercept such a remote call and either allow or prevent it by installing a function with rpc_mgmt_set_authorization_fn( )).

· A management application makes a remote procedure call using the routine dced_server_stop( )

· An administrator (or administrative script) uses the dcecp server stop server_name operation

· A signal or exception occurs

From the point of view of the server, the call to rpc_server_listen( ) blocks until the rpc_mgmt_stop_server_listening( ) routine is called. When this happens, the RPC runtime stops accepting incoming client requests to the server, and when all the currently executing operations are completed, the call to rpc_server_listen( ) returns.

Server operations can also be terminated by an exception or signal. DCE Threads defines all exceptions as terminating, which means that execution must be caught by an exception handler (if one exists) and then be resumed there, or the process will be terminated. Certain signals are defined by DCE Threads as exceptions, which means that these signals have the same general characteristics as exceptions. For more information on the DCE Threads exception handling interface, see Threads.