OSF DCE Application Development Guide--Core Components
Using the DCE Serviceability Application Interface
4.3.14.4 Importing and Accessing the Remote Interface
The following code fragments are intended to give an idea how a client might import
both the hello_svc server’s interface and its exported serviceability interface.
Note that (for brevity’s sake) status return checks have been omitted from this code.
/* Import binding info from namespace. */
for (server_num = 0; server_num < nservers; server_num++)
{
/* Begin the binding import loop. */
rpc_ns_binding_import_begin(rpc_c_ns_syntax_dce,
server_name[server_num], hello_v1_0_c_ifspec,
&obj_uuid, &import_context, &status);
/* Begin the svc binding import loop. */
rpc_ns_binding_import_begin(rpc_c_ns_syntax_dce,
server_name[server_num], NULL,
&obj_uuid, &svc_import_context, &status);
/* Import bindings one at a time. */
while (1)
{
rpc_ns_binding_import_next(import_context,
&bind_handle[server_num], &status);
rpc_ns_binding_import_next(svc_import_context,
&svc_bind_handle[server_num], &status);
/* Select, say, the first binding over UDP. */
rpc_binding_to_string_binding(bind_handle[server_num],
&string_binding, &status);
rpc_binding_to_string_binding(svc_bind_handle[server_num],
&svc_string_binding, &status);
rpc_string_binding_parse(string_binding, NULL,
&protseq, NULL, NULL, NULL, &status);
rpc_string_binding_parse(svc_string_binding, NULL,
&svc_protseq, NULL, NULL, NULL, &status);
rpc_string_free(&string_binding, &status);
ret = strcmp((char *)protseq, "ncadg_ip_udp");
rpc_string_free(&protseq, &status);
rpc_string_free(&svc_string_binding, &status);
svc_ret = strcmp((char *)svc_protseq, "ncadg_ip_udp");
rpc_string_free(&svc_protseq, &status);
124245 Tandem Computers Incorporated 4− 45