My program is a game that uses RMI to allow users to connect to the central server. The game works fine on computers within my home network. I want remote users outside of my network to be able to connect to the server.
Based on a similar thread’s recommendation I set up a no-ip.com account to map a domain to my game-server so that my computer is publicly accessible.
I changed my code to get a class stub From:
Registry registry = LocateRegistry.getRegistry("10.10.10.105");
/* 10.10.10.105 is my local address and this works fine on my home network */
To:
Registry registry = LocateRegistry.getRegistry("mychosenhostname.no-ip.org");
/* mychosenhostname.no-ip.org is the redirecting domain that I received from no-ip */
However this new code gets a java.rmi.ConnectException: Connection refused to host: error. I used the port checker tool on canyouseeme.org and found that my port 1099 is open. I’m not sure what else I need to do in order to make my program accessible.
BTW: I am using NetBeans IDE with Glassfish
I think I may have found the answer to my problem. My setup looked like ADSL Modem -> Router -> Machines.
Even though I had the ports forwarded from my DSL modem to the Router and then to the Machines, the DSL modem was completely ignoring its port forwarding settings. Once I set the DSL Modem in bridge mode and allowed just the router to handle the port forwarding it seemed to fix the issue.