From: nwinton@axion.bt.co.uk (Neil Winton)
Subject: Re: Multiple DCE Servers with the same Interface
Date: 15 Jun 1993 09:56:03 GMT [thread overview]
Message-ID: <1vk6bj$ooi@zaphod.axion.bt.co.uk> (raw)
In-Reply-To: C8ErMs.8E2@brunel.ac.uk
In article <C8ErMs.8E2@brunel.ac.uk>, cs89bps@brunel.ac.uk (Barry P Sheward) writes:
|> It's possible to have a single server export the same
|> interface several times using different names in the DCE namespace,
|> and have the RPC runtime "decide" which function to call to execute
|> each RPC based on which name service entry the client used to find its
|> binding.
|>
|> Could you give an example of how you would do this, or point me to
|> an example somewhere please ?
The behaviour of DCE with multiple instances of the same interface on the same
machine confused me when I first came across it. If you look at the comments
in /usr/include/dce/rpc.idl (a very useful source first port of call
for information before delving into the full documentation!) you will see the
following comment:
/*
* R P C _ E P _ R E G I S T E R
*
* Register entries with the local Endpoint Map. Endpoint map entries
* logically consist of <if_spec, address, object, annotation> tuples.
* The object_uuid_vec and annotation are optional; NULL may be
* specified.
*
* Registrations tuples that differ only in the endpoint portion of the
* address are defined to be duplicate registrations and the new
* registration replaces the old registration. The old registration
* is assumed to be stale (i.e. from a previous instance of the server
* that exited without unregistering).
*/
So, in order to have multiple instances of a server you will have to supply
an Object UUID or else subsequent registrations of the endpoint will overwrite
each other.
Basically the code goes something like this (with error checking and other stuff
omitted):
unsigned32 status;
struct
{
unsigned32 count;
uuid_t *uuid[1];
}
uuid_vec;
uuid_t *uuidp = NULL;
/* Create UUID for interface */
uuidp = (uuid_t *) malloc(sizeof(uuid_t));
uuid_create(info->uuidp, &status);
uuid_vec.count = 1;
uuid_vec.uuid[0] = uuidp;
/* Register server interface */
rpc_server_register_if(interface_spec,
NULL,
NULL,
&status);
if (*status != rpc_s_ok) goto cleanup;
/* ... stuff to get binding vector (bvec) omitted ... */
/* Register end-points */
rpc_ep_register(interface_spec,
bvec,
&uuid_vec,
NULL,
&status);
/* Export to name service */
rpc_ns_binding_export(rpc_c_ns_syntax_dce,
name,
interface_spec,
bvec,
&uuid_vec,
status);
Note that you don't have to associate a Type UUID with the Object UUID. If you
export the interface with different names, the lookup will find the correct
server associated with the name-service entry. The server code can be identical
but for the name exported.
(BTW, I'd be really grateful if someone could explain the rationale for having to
associate Type UUIDs with Object UUIDs when you wish to select from multiple
services within a single server. There seems to be a an unnecessary level of
indirection, or am I missing something?)
|> The reason I decided I would need a UUID, because I plan to have some
|> facilities for replicating data, so a server could potentially
|> provide the exact same results to as function call, but on a different
|> machine.
|>
|> Would this work using the DCE namespace to do lookups ?
Having given you all the information above, it is unnecessary if the servers are
running on different machines. In this case the name-space lookup is sufficient.
It will resolve to an interface/host-address tuple which will be sufficient to
locate an instance of a server on a machine.
|> Thanks,
|>
|> Barry.
I'm glad to be able to help.
Neil
* Neil Winton G306a, SSTF Building This sentence
* N.Winton@axion.bt.co.uk BT Laboratories has two missing,
* Tel +44 473 646079 Martlesham Heath but you can still
* Fax +44 473 643019 IPSWICH IP5 7RE, UK sense of it.
next prev parent reply other threads:[~1993-06-15 9:56 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
1993-06-07 17:50 Multiple DCE Servers with the same Interface Barry P Sheward
1993-06-08 15:48 ` Greg Brail
1993-06-10 13:47 ` Barry P Sheward
1993-06-15 9:56 ` Neil Winton [this message]
1993-06-15 12:11 ` Rich Salz
1993-06-16 14:05 ` DCE Type vs Object UUIDs (Was: Re: Multiple DCE Servers with the same Interface) Neil Winton
1993-06-16 18:29 ` Rich Salz
1993-06-17 16:42 ` Neil Winton
1993-06-18 21:02 ` Greg Brail
1993-06-21 12:38 ` Rich Salz
1993-06-22 21:45 ` Greg Brail
1993-06-23 18:59 ` Rich Salz
1993-06-24 15:14 ` Greg Brail
1993-06-10 0:00 ` Multiple DCE Servers with the same Interface Per Igel
1993-06-11 19:54 ` Examples of IDL unions Naved Khan
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox