Problem with orber, alternate iiop and naming service rebind
BETIS Alexandre
A.BETIS@REDACTED
Thu Jun 12 12:33:53 CEST 2003
Hi,
We are currently using the Erlang implementation of the CORBA Event Channel, replacing a previously existing one.
We have one rather mischevious problem, though, and we can't seem to find our way out. Erlang version is 5.2
We have the following code to start our event channel:
-----------------
-module(event_channel).
-export([start/0,stop/0,start_orb/0,start_event/0]).
start()->
start_orb(),
start_event().
stop()->
orber:uninstall().
start_orb() ->
orber:configure(iiop_port,1450),
% Must use version 1.2 (for corba:add_alternate_iiop_address(...))
orber:configure(giop_version,{1,2}),
% Start orber
mnesia:start(),
corba:orb_init([{domain,"MyDomain"}]),
orber:install([node()],[{ifr_storage_type,ram_copies}]),
orber:start(),
ok.
start_event() ->
cosEventApp:install(),
cosEventApp:start(),
% Create event channel
Channel = 'oe_CosEventComm_Channel':oe_create([{domain,"MyDomain"},{blocking,false}],[{persistent,true}]),
% Add additional iiop address
CompleteChannel = corba:add_alternate_iiop_address(Channel, "localhost", 1450),
% Register full reference (with both iiop addresses) in naming service
Naming = corba:string_to_object("corbaloc::1.0@REDACTED:1235/NameService"),
Name = lname:new(["CosEventService"]),
'CosNaming_NamingContext':rebind(Naming,Name,CompleteChannel),
CompleteChannel.
-----------------
We would like our channel to listen for requests on two specific interfaces: a network card and the loopback (==localhost). Thus can we have robust CORBA connections locally to the machine where the event channel is running.
So, we make our event channel listen on all interfaces (default), and we would like to publish (via the naming service) a double reference. With the previously used ORB, this resulted into having two IORs available under the same name in the naming service.
With Orber, we could verify that only the network interface is visible in the registered CORBA reference. Our processes, when using the naming service, only get a reference to the network interface :b. When we lose the network, our local applications lose their event channel connection instead of using the local loopback.
Apparently, the :rebind does not make the alternate IIOP visible in the IOR submitted to the naming service.
Can anyone suggest a fix / workaround / hack for that?
Alexandre Betis
More information about the erlang-questions
mailing list