Identifying Which Client is Calling Remote Method
843793Aug 2 2004 — edited Aug 5 2004I'm creating an example of client callback of Java RMI to understand how it
works.
But i've some problems.
I've 1 Server and N clients.
It has to work similarly to an IRC server.
Server Remote Methods:
login(String nickname, String password, ChatClientInterface clientlink)
logout(ChatClientInterface clientlink)
Client Remote Methods:
join(String nickname)
part(String nickname)
In few words.. a client call the server method
login("mynick", "mypass", this);
(with "this" I pass the reference to the client interface)
Ok.. server receive this call, check if "mynick" and "mypass" are correct,
and if yes, it stores in a list the reference to that client interface.
in a second moment.. when client wants to logout it calls:
logout(this);
The server receive this call, it have to search for which is the "nickname"
asked to logout, and for doing this I though to scroll my list of "interface
links" and watch when I found a matching one!
The problem is that it never matches...
In few words, I cannot use the client interface link to identify the UNIQUE
client who is calling the remote method on the server?
What is the best way to understand which of the N client is invoking the
remote method on server?
Thank you very much