Re: Binding to no particular address/INADDR_ANY?



Quoting "Toralf Lund" <toralf lund pgs com>:

Toralf Lund wrote:
Frank Rehberger wrote:

On 16.09.2010 13:54, Toralf Lund wrote:

When setting up a TCP/IP based server ORB, I can specify the IP
host-name to bind to *via option -ORBIIOPIPName=..., or use an
internal default, which is influenced by the value of -ORBNetId. But
it does not seem like I can choose not to bind to an address at all,
as in set up the server to listen for connections on ANY interface the
machine may have. Why is that? Or is there some way I can do this?
I've **-ORBIIOPIPName=0.0.0.0 based on the theory that this would be
like specifying INADDR_ANY in a socket address structure, but it
didn't seem to work...

ORBit2 has not been designed for this case. Nonetheless, it would be
possible to add this INADDR_ANY  feature.

Listening to all interfaces, would require to encode all endpoints into
each object reference, which could be implemented quite easily, but
blowing up the IORs extremely. Moreover, using this strategy for
clients  it becomes unclear which of the encoded endpointsin IOR is
reachable/routable, which may cause timely connection-trials.

I don't understand what you are talking about here, I'm afraid.
Actually, I think I do understand what you mean about the IOR strings now that I think about it. It's just that

  1. I haven't really thought a lot about support for multiple network
     interfaces. However, life would be *a lot* easier if I could only
     set up the ORB so that it would allow connections via
     localhost/loopback (i.e. a 127... address) in addition to a real
     IP address.
  2. I don't really care about IOR strings anyway. I'd be happy with a
     setup where a lookup of one of those only tried one of the
     available addresses, as long as corbaloc: would also work for the
     others.


A straight forward solution to implement this kind of feature into ORBit2 would look like this, few changes in server, major search strategy in client.

if server socket bound to 0.0.0.0
* if creating the IOR/corbaloc then iteratate all interfaces and encode them into (instead of the 0.0.0.0)

if client connecting to IOR containing multiple interfaces:
* if client-address equals one of the addresses in IOR, check if 127.0.0.1 is also encoded. If so, choose this one (127.0.0.1) to connect, otherwise iterate the list of server endpoints until connection succeeded (could be parallized, so connecting to fastest one)

Regards, Frank



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]