PreviousNext

Registering and Exporting the Remote Interface

The following code fragments show how the remote serviceability interface could be exported and registered by a hello_svc server. Note that only the steps that are closely or directly related to exporting and registering the server's and the serviceability remote interface are shown. For a full example of how to get a DCE server application up and running, see the OSF DCE Application Development Guide - Introduction and Style Guide.

The steps shown are the following:

1. Register interfaces with the RPC runtime

2. Request binding handles for the server interface from the RPC runtime

3. Request binding handles for the serviceability interface from the RPC runtime

4. Register both sets of binding handles with the endpoint map

5. Export both sets of binding handles to the namespace

Note that (for brevity's sake) status return checks have been omitted from this code.


<. . .>


/* Register server interface/type_uuid/epv associations */

/* with rpc runtime. */

rpc_server_register_if(timop_v1_0_s_ifspec, &type_uuid,

(rpc_mgr_epv_t)&manager_epv, &status);


/* Register serviceability remote interface with rpc */

/* runtime ... */

rpc_server_register_if(serviceability_v1_0_s_ifspec, &type_uuid,

(rpc_mgr_epv_t)&dce_svc_epv, &status);


<. . .>


/* Tell rpc runtime we want to use all supported protocol */

/* sequences. */

rpc_server_use_all_protseqs(MAX_CONC_CALLS_PROTSEQ, &status);


/* Get server binding handles ... */

rpc_server_inq_bindings(&hello_bind_vector_p, &status);


/* Get binding handles for serviceability remote */

/* interface ... */

rpc_server_inq_bindings(&svc_bind_vector_p, &status);


<. . .>


/* Register endpoints with server interface ... */

rpc_ep_register(hello_v1_0_s_ifspec, hello_bind_vector_p,

(uuid_vector_t *)&obj_uuid_vec,

(unsigned_char_t *)"hello server, version 1.0",

&status);


/* Register endpoints with serviceability interface ... */

rpc_ep_register(serviceability_v1_0_s_ifspec, svc_bind_vector_p,

(uuid_vector_t *)&obj_uuid_vec,

(unsigned_char_t *)"Hello SVC",

&status);


/* Export server interface binding info to the namespace. */

rpc_ns_binding_export(rpc_c_ns_syntax_dce, server_name,

hello_v1_0_s_ifspec, hello_bind_vector_p,

(uuid_vector_t *)&obj_uuid_vec, &status);