logo       

Re: Identifying Client Callbacks: msg#00028

java.sun.rmi

Subject: Re: Identifying Client Callbacks

> 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?

Is the client exporting its ChatClientInterface implementation with a
custom client socket factory? If so, does that factory's class
properly override Object.hashCode and Object.equals?[*]

Does the result of invoking toString() on the clientlink objects
received on the server side produce matching strings when expected?

-- Peter

[*] http://developer.java.sun.com/developer/bugParade/bugs/4492317.html
http://java.sun.com/j2se/1.4/docs/api/java/rmi/server/RMIClientSocketFactory.html
http://java.sun.com/j2se/1.4/docs/api/java/rmi/server/RMIServerSocketFactory.html

===========================================================================
To unsubscribe, send email to listserv@xxxxxxxxxxxx and include in the body
of the message "signoff RMI-USERS". For general help, send email to
listserv@xxxxxxxxxxxx and include in the body of the message "help".

For a list of frequently asked RMI questions please refer to:
http://java.sun.com/j2se/1.3/docs/guide/rmi/faq.html

To view past RMI-USERS postings, please see:
http://archives.java.sun.com/archives/rmi-users.html



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise