This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: InetAddress.getLocalHost()


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/





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]