简体   繁体   English

Java RMI-从本地实施到远程实施

[英]Java RMI - Implementing Local to Implementing Remote

I understand and have coded up some RMI code and it works. 我了解并已经编码了一些RMI代码,并且可以正常工作。 I can create a RMIServer object and a RMIClient object and the client can send messages to the server and the server receives it perfectly. 我可以创建一个RMIServer对象和一个RMIClient对象,并且客户端可以将消息发送到服务器,并且服务器可以完美地接收它。

My question is how do I communicate between two different computers in different parts of the world? 我的问题是如何在世界不同地区的两台不同计算机之间进行通信?

When you connect to the RMI server you provide an IP or name of the machine hosting the server. 当您连接到RMI服务器时,请提供托管该服务器的计算机的IP或名称。 You will simply provide the IP/name of the RMI server in place of the one you're currently using. 您只需提供RMI服务器的IP /名称来代替您当前使用的服务器。

To get your ip, if you have windows go to start ->run-> write cmd. 要获取IP,如果您有Windows,请转到开始->运行->编写cmd。 now in the console write ipconfig your ip is ADDRESS IP. 现在在控制台中写入ipconfig,您的ip是ADDRESS IP。 Remember, if you have dynamic ip (unless your supplier get you a static ip) this change when restart your pc 请记住,如果您具有动态IP(除非您的供应商为您提供了静态IP),则在重新启动PC时进行此更改

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

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