[omniORB] does persistent example work?
Jonathan Clark
jc@jonathanclark.com
Tue, 11 Jul 2000 08:17:24 -0700
First off, I'm using ORB 3.0 pre-release under Win2k.
When I run the persistent_objref sample program I get different IOR's each
time I run it for example:
run 1
-----
IOR:010000000d00000049444c3a4563686f3a312e3000000000010000000000000032000000
010100000c0000003139322e3136382e322e3200390b000016000000ff6d7920706f61006d79
206563686f206f626a656374
>>>catior
Type ID: "IDL:Echo:1.0"
Profiles:
1. IIOP 1.0 192.168.2.2 2873 ".my poa.my echo object"
run 2
-----
IOR:010000000d00000049444c3a4563686f3a312e3000000000010000000000000032000000
010100000c0000003139322e3136382e322e32003a0b000016000000ff6d7920706f61006d79
206563686f206f626a656374
>>>catior
Type ID: "IDL:Echo:1.0"
Profiles:
1. IIOP 1.0 192.168.2.2 2874 ".my poa.my echo object"
this occurs regardless of if I use no
arguments, -ORBInitialPort, -ORBInitialHost, or any combination.
Stepping through the source code, it appears that the initial port that is
bound to is always chosen by the OS:
objectAdapter.cc:
// here 0 is always used to bind to a port (???)
_tcpEndpoint e((const CORBA::Char*) hostname, 0);
factory->instantiateIncoming(&e, 1);
I noticed there is some code in corbaOrb.cc that looks like this:
if( bootstrapAgentHostname ) {
// The command-line option -ORBInitialHost has been specified.
// Override any previous NamesService object reference
// that may have been read from the configuration file.
omniInitialReferences::remFromFile("NameService");
omniInitialReferences::remFromFile("InterfaceRepository");
omniInitialReferences::initialise_bootstrap_agent(bootstrapAgentHostname,
bootstrapAgentPort);
}
Here initialize_bootstrap_agent appears to be important - though it is only
called
if -ORBInitialHost is set... shouldn't that *also* be if
only -ORBInitialPort is set?...
i.e. currently if only -ORBInitialPort is set then
initialise_bootstrap_agent is not called.
When initialize_bootstrap_agent *is* called, the proper command-line port is
encoded
into a partial IOR somewhere in initRefs.cc, but this is never used on the
later bind! I
have the feeling I'm missing something obvious, or is this a bug?
If I change objectAdapter.cc to use a fixed port like this
_tcpEndpoint e((const CORBA::Char*) hostname, MY_FIXED_PORT); I get a
persistant IOR.
Jonathan