Archived

This forum has been archived. Please start a new discussion on GitHub.

question about default host of endpoints

I used Ice-2.1.2 before, in that version,
if I didn't specify a host for endpoints,
then, the default host should be the "gethostname".

I think that's quite perfect.

for example, I have a service to run on different machines,
I can set all these machines' hostname to the network interface that I want.
so I don't need to specify different value of the endpoints for the same service.

but the newly release of Ice, change this policy,
if not specify the host of endpoints,
the object adapter listens on all network interfaces.

I don't want to specify the host of endpoints for every object adapter,

and I tried the "Ice.Default.Host", but it was not what i wanted.

so I read the source code of Ice, then, change it for myself.

for C++ version, the relative file is
Ice-3.2.0/src/Ice/Network.cpp
the function is:
vector<string> IceInternal::getLocalHosts()
I change it to return only the ip of hostname.

for Java version, the relative file is
IceJ-3.2.0-java5/src/IceInternal/Network.java
the function is:
public static java.util.ArrayList getLocalAddresses().

but I do expect you can give a Property,
so users can customize how many ip the object adaper would bind.

thank you.