OSF DCE Application Development Guide--Introduction and Style Guide
OSF DCE Application Development Guide—Introduction and Style Guide
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 Chapter 2.
1.5.8 Cleaning Up Code When the Server Terminates
If (or when) the server terminates execution, it should undo its initialization that affected
other facilities and services of DCE. Facilities affected include the CDS namespace, the
endpoint mapper service, and backing store databases such as those used for ACL
managers. For the most part, API routines that cause these kinds of effects have a
corresponding API routine to undo them. The following sections describe the series of
routines typically used to clean up after an application.
1.5.8.1 Unregistering the Server
Two important aspects of registering the server is that it registered the interfaces and
EPVs with the RPC runtime, and it established the endpoints (or addresses) on which the
server listened for requests. If the endpoint map contains stale data, it can create for a
client a fully bound binding that is not valid. Even though the endpoint mapper service
does its own housecleaning periodically, there is the possibility that these invalid
bindings could be created and used. Therefore, it is a good idea to call the following
1− 24 Tandem Computers Incorporated 124246