posted 23 years ago
Venkataraman,
You've got two choices; it depends on whether you want the unique per-client identifier held on the client or server side. (It's got to go somewhere; those are the only choices.)
If your remote clients all receive the same remote reference to your server class (that is, if you don't create any 1-per-client server-side objects), then you'll want to give each client instance a unique identifier that they pass to the server as a parameter in every remote method call. java.rmi.server.UID works well for this approach. You'll have to generate the UID on the server when the client first connects. You shouldn't generate it on the client for two reasons: 1) security, and 2) UID is only guaranteed unique with respect to the host its generated on.
If your server design uses a per-client proxy class, then identifying unique clients is easy. You use the proxy object itself as the identifier.
Jerry