This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: InetAddress.getLocalHost()
- From: Mohan Embar <gnustuff at thisiscool dot com>
- To: Erik Poupaert <erik dot poupaert at chello dot be>
- Cc: java at gcc dot gnu dot org
- Date: Sun, 22 Jun 2003 09:45:22 -0500
- Subject: Re: InetAddress.getLocalHost()
- Reply-to: gnustuff at thisiscool dot com
Hi Erik,
>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.
Here is my knee-jerk reaction to this, which is admittedly off-topic for this list, but
I'm the one who asked:
Why not have the server listen on a known port for "register subscriber / deregister subscriber"
operations. When a client registers its interest in a subscription, the server can then
retrieve the remote address of the client via getInetAddress() of the client socket
obtained via ServerSocket.accept().
If you're worried about the remote IP address changing because of DHCP and all you
need is a unique identifier, you can have the client generate and remember a UUID:
http://www.doomdark.org/doomdark/proj/jug/
My apologies to the list for going on this tangent here.
-- Mohan
http://www.thisiscool.com/
http://www.animalsong.org/