[omniORB] "Persistent" IORs

Peter Craig pcraig@coactive.com
Tue, 1 Dec 1998 15:18:10 -0800


On the server where you create your object, pass the static key to the
constructor:

    orb =3D CORBA::ORB_init(argc,argv,"omniORB2");
    boa =3D orb->BOA_init(argc,argv,"omniORB2_BOA");
 =20
    objectKeyVariant  key;

    key.modKey.hi =3D 2;
    STRNCPY(key.modKey.cstrKey, "XXXXXXXX", 8);

    COI::test_i *testObj =3D new COI::test_i(key.objKey);
    testObj->_obj_is_ready(boa);

On the client, use genRef (from the genIOR utility) to create the IOR:

    CORBA::Char * iorTest =3D genRef =
(CORBA::string_dup("IDL:test:1.0"),
		CORBA::string_dup("255.255.255.255"),    // <-- insert
your IP address here
		2000,=20
		CORBA::string_dup("0x020000005858585858585858"),
		1);

    CORBA::Object_var obj =3D orb->string_to_object((const char
*)iorTest);

    test_ptr testobj =3D test::_narrow(obj);

I passed the hex form of the key to genRef, you can also pass a
character string.

Peter Craig (pcraig@coactive.com)
Sr.Software Engineer    =20
Coactive Networks, Inc. (http://www.coactive.com)
4000 Bridgeway, Suite 303, Sausalito, CA 94965

> -----Original Message-----
> From:	Thor =C5ge Eldby [SMTP:thore@fairplay.no]
> Sent:	Tuesday, December 01, 1998 2:14 PM
> To:	omniorb-list
> Subject:	[omniORB] "Persistent" IORs
>=20
> Hi
>=20
> As understand it, it should be possible create objects with
> "persistent"
> IORs. The IORs are persistent in the way that they do not change for
> every application run.=20
>=20
> It says in the "2.8.4 Lifetime of an Object Implementation", third
> paragraph that this will be described in a later part of the manual,
> but
> I seem be unable to find it.
>=20
> Have a nice day
> Thor=C5ge
> --=20
> Thor =C5ge Eldby                 FairPlay International
> Home: eldby@online.no         Work: thore@fairplay.no
> Home: +47 22 71 05 76         Work:   +47 22 40 55 20