简体   繁体   English

在 Java RMI 中的远程客户端上进行远程查找

[英]remote lookup on a remote client in Java RMI

As long as I run multiple clients on my local host everything works just fine.只要我在本地主机上运行多个客户端,一切都可以正常工作。 Problems arise when I start a client on a different host.当我在不同的主机上启动客户端时会出现问题。

For instance, at some point during execution methods on the server are invoked with localhost as the destination, meaning that the server suddenly forgets about the remote client's IP address.例如,在执行过程中的某个时刻,服务器上的方法以 localhost 作为目标调用,这意味着服务器突然忘记了远程客户端的 IP 地址。 How is that possible?这怎么可能?

Also, remote lookup performed by the server takes forever to complete.此外,服务器执行的远程查找需要很长时间才能完成。 Could it be my router denying access to it?难道是我的路由器拒绝访问它? Or is the server desperately trying to use different paths to get to the remote host?还是服务器拼命尝试使用不同的路径到达远程主机?

Servers don't need to perform remote lookups.服务器不需要执行远程查找。 Clients do that.客户这样做。

If your clients are throwing ConnectExceptions indicating they are trying to connect to 'localhost' when they shouldn't be, see item A.1 of the RMI FAQ .如果您的客户端抛出 ConnectExceptions 表明他们不应该尝试连接到“localhost”,请参阅RMI FAQ的 A.1 项。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM