[omniORB] Persistent IOR
Alex Gilburd
agilburd@vicinium.com
Sat, 29 Apr 2000 12:07:20 -0400
Hi,
I am trying to create a persistent IOR for the client which is configured once
and
would need to have the same IOR even if server is restarted.
I understand that I have to set network location and object key to make IOR
persistent,
but I am not clear about correct implementation.
I found one reference in omniORB archives:
http://www.uk.research.att.com/omniORB/archives/1998-12/0008.html
So far I have:
typedef omniObjectKey objectKey;
struct modKeyType
{
unsigned long hi;
char cstrKey[8];
};
typedef union {
modKeyType modKey;
omniORB::objectKey objKey;
} objectKeyVariant;
server main:
int main(int argc, char* argv[])
{
objectKeyVariant key;
key.modKey.hi = 2;
strncpy(key.modKey.cstrKey, "C2kEvent", 8);
CORBA::ORB_var orb = CORBA::ORB_init(argc, argv,"omniORB2");
CORBA::BOA_ptr boa = orb->BOA_init(argc,argv,"omniORB2_BOA");
CoactiveEvent_impl *ce = new CoactiveEvent_impl(key.objKey);
ce->_obj_is_ready(boa);
async_var asyncRef = ce->_this();
CORBA::String_var str = orb->object_to_string(asyncRef);
cout << str << endl;
FILE *iorfile = fopen("ior.out", "w");
fprintf(iorfile, "%s", (char *)str);
fclose(iorfile);
boa->impl_is_ready();
}
Could you tell me what else do I need to do, because each run of this server
produces different IOR?
Client is a third party application which needs this IOR, it can be set only
once.
Thanks,
Alex