InetAddress.getLocalHost()

Mohan Embar gnustuff@thisiscool.com
Sun Jun 22 14:45:00 GMT 2003


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/


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /