OSF DCE Application Development Guide--Core Components
DCE Host Services
name input. Each name used to identify an object of each
service has a UUID. If dced maintains a UUID for a
srvrexec object, the server is running. However, it is
possible that the server is in an in-between state as it is
starting up or shutting down. For a more robust check as to
whether the server is running, use the dced_object_read( )
routine to read the server_t structure for the srvrexec object.
If the exec_data.tagged_union.running_data.instance UUID
is the same as the srvrconf UUID (srvrconf_id), the server is
running.
dced_server_start()
This routine starts the server via dced. The srvrconf binding
handle and UUID are input. For special server
configurations, you can start a server with a specific list of
attributes, but a value of NULL in the third parameter uses
the attributes of the server configuration data. You can input
a srvrexec UUID for dced to use, or allow it to generate one
for you.
dced_server_stop()
This routine stops a running server identified by its srvrexec
UUID. The cleanest stop method is to cause dced to use the
rpc_mgmt_server_stop_listening() routine so that all
outstanding remote procedure calls complete before the
server stops.
dced_binding_free()
Each call to the dced_binding_create() routine requires a
corresponding call to dced_binding_free() to release the
binding resources allocated.
2.6.4 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.
124245 Tandem Computers Incorporated 2− 23