Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set up my server to allow remote users to connect to my Java program

Tags:

java

ip

dns

rmi

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

like image 527
Robert Avatar asked Mar 23 '26 02:03

Robert


1 Answers

  1. Check the software firewall on your server. (If you haven't already ...)

  2. Check the ports on the machine you are trying to connect from, and its firewall, router, etc.

  3. If you are absolutely sure that you've got everything right, contact your ISP and ask if they are blocking the port.

like image 153
Stephen C Avatar answered Mar 24 '26 15:03

Stephen C



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!