[jacorb-developer] IIOPProfile with Bidir GIOP

Gergely Jakab jakab at extech.eu
Fri Apr 29 16:46:43 CEST 2016


Greetings,

we are using Bidirectional GIOP with JacORB 3.7, because most of our client apps are in a NAT and the server needs to send them requests.
I found out that the connection back to the client is not working if the client is multihomed (e.g. it has multiple active network interfaces). I am able to reproduce this behaviour if my machine (the client) is connected to my LAN via an ethernet cable and at the same time also via WiFi. I have then 2 different local IPs assigned to the 2 interfaces.
Let’s have for example IPs: 192.168.0.1 and 192.168.0.2.
Then I connect to my server with bidirectional connection from local port 64000.
Although the server sees my client via my public IP and port, the BiDirConnectionServerInterceptor is adding the connection to the ClientConnectionManager mapped by a new IIOPProfile containing my private IP and port 192.168.0.1:64000.

When the server tries to send a request to my client, it searches for existing connection in ClientConnectionManager with an IIOPProfile containing the correct IP and port 192.168.0.1:64000.
However the connection is not found and the server is trying to establish a new connection to my client via 192.168.0.1:64000 which is obviously not working.

After investigating the issue, I found that the reason of not finding the existing connection is due to the fact that the IIOPProfile which is the key for the connection in the HashMap inside ClientConnectionManager does not equal to the IIOPProfile via which the server is searching for an existing connection.
They differ in the 
boolean checkAlternateAddresses;    
flag and the 
protected TaggedComponentList  components;
inherited from ProfileBase. 

Due to this the IIOPProfile.getAlternateAddresses() (which is called in the IIOPProfile.equals()) return different lists for both profiles and hence the profiles are not equal.

The first profile is created in the BiDirConnectionServerInterceptor.addConnections() via the constructor 
public IIOPProfile(IIOPAddress address, byte[] objectKey, int minor)
 and has no alternate addresses set.

The second profile is created in the IIOPFactories.demarshal_profile()  (called from Delegate.bind()) via the constructor 
public IIOPProfile()
and has set as alternate address the secondary IP address of my client 192.168.0.2:64000.

It seems to be as a bug in JacORB and I did not find any configuration property which would influence it. My only idea of a workaround was to change the code of IIOPProfile.is_match() or IIOPProfile.getAlternateAddresses() so that the two profiles would be considered equal and the connection would be found.
But this would require building JacORB from sources and use in the company our customised JacORB. 
This I would like to avoid, so I am asking You if u could confirm that this is a bug and then I will report it in BugZilla and wait for a fix.
But in the meantime I would like to have some workaround, so if u have any idea how I could solve it, I would appreciate it.

Best regards,
Gergely Jakab
____________________
ExTech s.r.o.
http://www.extech.eu <http://www.extech.eu/>
____________________



More information about the jacorb-developer mailing list