At 11:11 AM 1/12/99 , Ben Laurie wrote:
>Hang on - no networking API has a notion of hosts _or_ interfaces. They
>have a notion of IP numbers, surely?
[+] In light of more recent mail message, I was confused when I wrote this.
I assumed that each interface was a separate TCP/IP socket world, and was distressed at the weakness with which Java's API scopes requests to interfaces. Now I understand that it's sensible to have operations scoped to host as well, so I'm much happier with Java's API. (The implementations of this API, however, still have the horrible non-invalidatable cache problem, but I've already flamed about that.)
However, it seems the only query to obtain all of a host's API addresses is
to first obtain your own host name with either
InetAddress.getLocalHost()
InetAddress.getByName(null)
and then use that name in
InetAddress.getAllByName(hostname)
This is all perfectly sensible *if* a given host only has one hostname.
or
My hope is that a host must have exactly one hostname.
>An IP number maps to an interface
>(maybe - for example, transparent proxies will map different ports on
>the same IP to different IPs behind the proxy!) and an interface maps to
>a host.
[?] When proxies do map, do they normally change port numbers also? If they do, this creates further problems for E.
>It seems to me that if A is currently talking to B and wants to be able
>to talk to B again in the future, then it is up to B to tell A how to do
>that (e.g. "use domain name X" or "connect to port Y on IP Z" or "make a
>query with contents V to domain name W" [this last being a bit scary,
>but might include, for example, LDAP queries]). A cannot guess by
>looking at B's hostname, IP address or DNS.
[-] B doesn't have the information A needs, given the possible mapping proxies discussed above. If B is behind a firewall and being remapped, it has no idea what address to tell A so that A or his buddies can contact B. Fortunately, A can figure out a workable (for A) IP address for B from the connection with B. However, it also needs a workable port number.
>BTW, apologies for not using this [#,?,...] stuff - where is it defined?
[?] Ping?