Jump to content
  • Advertisement
Sign in to follow this  
ChexWithRaisins

Java RMI - My client can not connect to server outside home network

This topic is 2512 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am developing an online CCG (collectible card game) using Java. Currently the game uses Java's RMI to allow players to send their moves to the server. It works fine so long as the client applications are run from a computer within my home network. However I can not figure out how to access the server when off of my network.

I recently purchased a server machine with Windows Home Server installed. I gave the machine a static IP within my network, and forwarded ports 80, 443, 4125 and 1099 (the default RMI port) to that IP. The OS on the server has Remote Web Access set up (I'm not sure if this is relevant). However I am not sure what host name to have the client connect to; I've tried the Remote Web Access domain name, and the IP found at whatismyip.com, and neither seemed to work.

What are the steps that I need to take in order to make my server visible outside my home network, so that the clients can access the server's RMI methods?

Share this post


Link to post
Share on other sites
Advertisement
First, you should look at firewall, port forwarding and NAT introduction links in the FAQ, as well as the question of "how do clients find my server?"

Second, try using Wireshark on the client when it's outside the firewall, to verify which port it's trying to use. Then make sure that's properly forwarded on your router/firewall, to your internal server address, and also that the firewall on the router and on the server box are correctly set to allow these connections.

Third, RMI is not a great general-purpose networked game protocol. It is usually verbose and usually has security issues. I'm not saying you should change it right now, just that you should be aware and plan to mitigate whatever problems may arise.

Share this post


Link to post
Share on other sites
You ether you need to manually do the port forwarding on your Firewall/Router like hplus0603 suggest, or you need to add in a UPnP Nat API so that it can do it automatically.

Share this post


Link to post
Share on other sites

First, you should look at firewall, port forwarding and NAT introduction links in the FAQ, as well as the question of "how do clients find my server?"

Second, try using Wireshark on the client when it's outside the firewall, to verify which port it's trying to use. Then make sure that's properly forwarded on your router/firewall, to your internal server address, and also that the firewall on the router and on the server box are correctly set to allow these connections.

Third, RMI is not a great general-purpose networked game protocol. It is usually verbose and usually has security issues. I'm not saying you should change it right now, just that you should be aware and plan to mitigate whatever problems may arise.


Thank you for your response, I started off by reading the FAQ on the site. I found the FAQ very helpful and informative, however it did not lead me to the solution to my issue. I will try the Wireshark application as you suggest to see what results it yields. In the meantime, you suggested that RMI is not the optimum solution. I am not married to the idea of RMI, its actual footprint on my overall program is very minimal, so I'd be open to better alternatives. Bear in mind though that since my game is a CCG, the calls between client and server typically average one every few seconds, which is probably much less than typical games.

Thanks!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!