[omniORB] Use of multiple NameServices

Patrick Decat pdecat@lfvie.generali.fr
Tue, 31 Jul 2001 17:15:03 +0200


Hi Petra,

AFAIK, it's not possible with omniORB's resolve_initial_reference.

you should just not use resolve_initial_reference to get your=20
name services root contexts but instead use string_to_object
with corbaloc urls, for example :

CORBA::ORB_var orb;
CORBA::Object_var obj;
CosNaming::NamingContext_var rootContext;

orb =3D CORBA::ORB_init(_argc, _argv, "omniORB3");
obj =3D =
orb->string_to_object("corbaloc:iiop:yourhost:12345/NameService");
rootContext =3D CosNaming::NamingContext::_narrow();

Regards,
Patrick.

----- Original Message -----=20
From: "Petra Bieber" <Petra.Bieber@alcatel.de>
To: <omniorb-list@uk.research.att.com>
Sent: Tuesday, July 31, 2001 3:56 PM
Subject: [omniORB] Use of multiple NameServices


>=20
>=20
> Hi All!
>=20
> Is it possible to switch between different NamingServices
> running at different hosts/ports without restarting the
> client process?
>=20
> I have the following network configuration:
>=20
>   hostA  - client process
>=20
>   hostB  - NameService1 running at port 2001
>            servant1 running (has registered at
>            NameService1)
>=20
>   hostC  - NameService2 running at port 2002
>            servant2 running (has registered at
>            NameService2)
>=20
> Note: Additionally, it is possible that servant1 is also running at
>       hostC and servant2 at hostB.
>       Furthermore, the number of NameServices/servants is changing
>       dynamically. Consequently, I cannot predefine those values in
>       omniORB's config file.
>=20
> The client knows both the IP addresses and the port numbers of
> the NameServices during runtime but not during its startup period.
> It has to ask NameService1 for the object reference
> of servant1 and NameService2 for the one of servant2.
>=20
> Has anybody an idea how to implement this behaviour?
>=20
> Thanks in advance,
> Petra
>=20
>=20