### Enabling and Disabling Services of a Server

Most servers have all their services enabled to process all requests. However, a server may need to enable or disable services to synchronize them, for example. For another example, an administrator (or management application) may need to disable or enable services to perform orderly startup or shutdown of a server.

Each service provided by a server is implemented as a set of procedures. DCE uses an interface definition to define a service and its procedures, and application code refers to the interface when controlling the service.

When a server starts, it initializes itself by registering with the RPC runtime and the dced process on its host by using the dce_server_register( ) routine. This enables all services (interfaces) that the server can support. The server can then disable and reenable services (in whatever order it requires) by using the dce_server_disable_if( ) and dce_server_enable_if( ) routines.

To control the services of remote servers, management applications use the dced_server_disable_if( ) and dced_server_enable_if( ) routines. These routines work on the srvrexec object. When a service (interface) is disabled, a client that already knows about the service (through a binding handle to this interface and server) will no longer work because the interface is unregistered with the RPC runtime. If you wish to have clients that already know about the server and service work, but wish to prohibit any new clients from finding the server and service, you can use rpc_mgmt_ep_unregister( ) to remove from the endpoint map the server address information with respect to the service. This routine does not affect the RPC runtime.

##