简体   繁体   中英

Java RMI: running RMI application over the Internet with public IP of router

We have developed a Java RMI distributed board game between peers in our LAN, using our private IP addresses (192.168.xx). Now our teacher has asked us to try our application at home: in other words, me and my colleague should play at our own house over Internet, in order to have a look at the performances of our application when it is nor running in a LAN. The basic functioning of our application is that each player know the IP addresses of all peers taking part into the match. Instead over Internet, we are supposed to use our public address, the one of our modem router (with open ports and which will forward incoming data to port 1099 into our machine). Is there a simple way to get it from java code? How can I get my public IP in order to communicate it to other peers? Thanks

http://ipaddress.com , but what the teacher wants is only possible if you have a programmable router in which you can open ports and forward them internally. Many routers do not have this capability: mine, for example (combination modem/router supplied by the ISP).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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