标签: java rmi
有没有办法在Callee远程方法中确定调用者进程。
假设有3个客户端,服务器和服务器有一个远程方法,由所有客户端调用。是否有可能在运行时确定哪个客户端进程称为远程方法? (除了在方法中传递进程名称)
Server void callMe(){//remote method System.out.println("I was called by Client : " + ? ); } Client ... ... server.callMe(); ... ...
答案 0 :(得分:1)
请参阅Determine remote client IP address for Java RMI call和Get the client Ip address in RMI Server when cleint makes a call registry.lookup("RMI Server")