问题
I want to get the ip address of each client in the server side for which the server return a stub. Is it possible?
回答1:
See RemoteServer.getClientHost(). You can invoke that inside your remote method implementations. You can't get it when they do the Registry lookup however.
来源:https://stackoverflow.com/questions/4623053/get-the-client-ip-address-in-rmi-server-when-cleint-makes-a-call-registry-lookup