InetAddress.getLocalHost()
Erik Poupaert
erik.poupaert@chello.be
Sun Jun 22 13:44:00 GMT 2003
> Andrew> Out of interest, why do you want to know the local IP address in any
> Andrew> case?
> I am also interested in your answer to Andrew's question.
I'm "experimenting" with clients that subscribe/unsubscribe by supplying any one of
their network identification numbers to a server, so that the server can add/remove
them to/from the subscription list.
The server process is (a bit confusingly) called "queueclient", because one if its
roles, is polling a queue (a directory) to see if new messages need to be broadcast
(to the subscription list, that is).
There are various options. I've tried with dns-name, ip-address, even considered mac
address.
I've now temporarily settled on dns-name, even though I still haven't figured out how
clients will be able to get their ip address from dhcp, while still maintaining a
stable dns record for their machine name. Using ip-address as "return to
sender"-address might have addressed the problem. But then again, I'll kick off with
dnsname and see how it goes.
This setup is a combination of queueing & subscribe/unsubscribe stuff I'm
experimenting with. The objects are xmlrpc queries.
Look, I'm no exegete at any of these things.
Actually, I have no experience in these matters. I just wanted some simple setup,
that other people could look at (who are maybe better knowledgeable on these things);
so that the setup can be improved with regards to reliability and performance
(without making it more complicated than strictly necessary).
So, I intend to release these things, so that other people could tell me how I should
have done it instead :)
More information about the Java
mailing list