Originally posted by vukicevic This might be a general issue with many linux configs; I know Red Hat's installer sticks the machine hostname as an alias for 127.0.0.1 in /etc/hosts as well. Any reason not to use INADDR_ANY for binding when no explicit hostnames are given?
Originally posted by marc We don't use INADDR_ANY, because this would really imply multiple endpoints. This leads to problem with detecting if for example an Ice object is collocated.
Originally posted by marc Let's assume you have a host with three interfaces, plus loopback, let's say host1, host2, host3, and localhost.
Now you configure an OA with INADDR_ANY, meaning that it will accept requests from all these. But if you create a proxy to send to a client, which endpoints should it contain?
Originally posted by alexander Client must establish connection in order to make request, right. You use client connection to determine to which ip address it connected and use that addres to construct proxy.
Originally posted by marc Also, given a proxy, how can I find out if the proxy is local with respect to an object adapter, if the object adapter uses IPADDR_ANY?
Originally posted by vukicevic Hmm, I think the other problem is more difficult to solve, as marc said.. for an adapter bound to INADDR_ANY, you have no way of creating a proxy identifier. I wasn't thinking of this when I brought up INADDR_ANY originally.
Originally posted by marc Sorry, I'm afraid I don't understand what you mean.
The object adapter creates a proxy. Which endpoints with which IP addresses does it put into the proxy, if you use INADDR_ANY for the object adapter?
Also, given a proxy, how can I find out if the proxy is local with respect to an object adapter, if the object adapter uses IPADDR_ANY?
For both problems, I need a method to get all IP addresses of the server.
Originally posted by alexander Well, create proxy with INADDR_ANY as its ip address. When proxy is about to be transferred to some client, ajust proxy address to one used by _this_ client to connect to the server.
In that case, if proxy has INADDR_ANY as its ip address then it wasn't transferred and it's a local proxy. If proxy received from remote host, its ip address has alredy changed to some specific address and it is a remote proxy.
Originally posted by marc Sorry, but this does not work.
There is no way to predict over which path a proxy will eventually make it to a client. It could be direct as the result of an operation call, it could be indirect over another service, and it could even be indirect using a lookup service, and then back to a client collocated to the server. You could even write the proxy to a database in string-form, and then read it back from the database from some other Ice client or server.
The point is, you cannot modify any endpoint information in a proxy, because you don't know how, when, and by whom the proxy will be used.
Right, that's what I was talking about, I need a method to get all interfaces. For Java, there is some portable code, but I know of none for C++. If anyone has such code, please give it to me