Discussion:
[omniORB] Strange omniORB domain socket behavior
John Kamenik
2006-10-03 03:56:24 UTC
Permalink
I am using omniORB 4.0.7 and have found that Unix Domain sockets are
tied to the hostname and if you change the hostname the IOR no longer
works because it cannot get a usable profile with the new hostname.
Is there a way to get omniORB to assume "localhost" if a unix socket
is used, instead of looking up hostname?

Simple Example (Note: programs were in Python):

oldname $ ./echo_server -f /tmp/echo.ior
oldname $ ./echo_client -f /tmp/echo.ior "testing"
testing
oldname $ hostname newname
newname $ ./echo_client -f /tmp/echo.ior "test again"
CORBA.TRANSIENT(omniORB.TRANSIENT_NoUsableProfile,CORBA.COMPLETED_NO)


The following is my omniORB config file:

endPointPublishAllIFs= 1
endPoint = giop:unix:
serverTransportRule = localhost unix
clientTransportRule = * unix


I have limited the CORBA objects to only use unix sockets because
both the computer's IP address and hostname could change.


John T. Kamenik (Software Eng.)
***@patton.com
(301) 975 - 1000 (ext. 168)
Patton Electronics Co.
7622 Rickenbacker Dr.
Gaithersburg, Md 20879
Duncan Grisby
2006-10-04 18:02:25 UTC
Permalink
Post by John Kamenik
I am using omniORB 4.0.7 and have found that Unix Domain sockets are
tied to the hostname and if you change the hostname the IOR no longer
works because it cannot get a usable profile with the new hostname.
Is there a way to get omniORB to assume "localhost" if a unix socket
is used, instead of looking up hostname?
oldname $ ./echo_server -f /tmp/echo.ior
oldname $ ./echo_client -f /tmp/echo.ior "testing"
testing
oldname $ hostname newname
newname $ ./echo_client -f /tmp/echo.ior "test again"
CORBA.TRANSIENT(omniORB.TRANSIENT_NoUsableProfile,CORBA.COMPLETED_NO)
omniORB uses the hostname to tell if the IOR is for an object on the
same host, and therefore can be contacted by Unix domain sockets. If it
didn't do tha, then when it received an IOR with Unix socket info in it,
it would have no way of knowing whether it was valid to try the Unix
socket or not. It could end up contacting a local server when it was
meant to be contacting a remote one.

There is no option to put anything other than the hostname in the Unix
socket profile, and it's hardcoded to match it against the hostname when
deciding if a Unix socket can be used. If you want to change that, the
code is in src/lib/omniORB/orbcore/ior.cc.

Cheers,

Duncan.
--
-- Duncan Grisby --
-- ***@grisby.org --
-- http://www.grisby.org --
Loading...