Determine remote client IP address for Java RMI call

自闭症网瘾萝莉.ら 提交于 2019-11-30 17:14:37

问题


When I implement an RMI server (implement an interface that extends java.rmi.Remote) is there a way to get information about the current RMI request context, specifically the remote client's IP address?

public void myMethod() throws RemoteException {

    log.info("remote IP is "+ RMISomething.getSomething());

}

回答1:


See java.rmi.server.RemoteServer#getClientHost



来源:https://stackoverflow.com/questions/590257/determine-remote-client-ip-address-for-java-rmi-call

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!