Jump to content
  • Advertisement
Sign in to follow this  
Furie

Socket and portforwarding problem

This topic is 4834 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

Ive created a small server program (written in java) that just takes an incomming connection on a port and just sends a message on that connection. The program is on a computer on a network that has a firewal that distributes ip. The firewal has been set to "port forward" any connection to that computer. The program works fine when I connect to it localy (ither 127.0.0.1 or an 192.168 adress). It even works fine when I connect to it from outside the network. What doesnt work tho is when I try to connect from inside the network to the external ip. Wierd thing is.. the connection gets accepted, on the local 192.168 adress rather then the external adress as I would have expected. Even tho the connection is accepted, I cant use it. The server just gives me the message "Connection reset by peer". anyone else have this problem? know any way to solve it? Any help would really be apriciated ^_^;

Share this post


Link to post
Share on other sites
Advertisement
Quote:
What doesnt work tho is when I try to connect from inside the network to the external ip.


Your firewall is causing this. It could potentially do two-way NAT from nodes within the network, but apparently it doesn't. Call the vendor and ask for a fix ;-)

The only other alternative is to find out the internal address on the client, and connect to that instead. You could, for example, use something like Rendez-vous, or something else based on UDP broadcast, to find the service you want on the local subnet; if you can't find it that way, connect to the known IP address (presumably found using DNS).

Or, if this is for testing only, just allow the address to be specified on the command line.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!