Game Multiplayer - Port Forwarding

Hi,

Firstly, my apologize but English is not my mother language:)
I’m trying to make a multiplayer game with Cling so I made an test server, but the clients can’t connect to the server. (The server is behind NAT). I hope somebody can help me with my problem.
The server side:
http://pastebin.java-gaming.org/c18619051541a
The client:
http://www.java-gaming.org/?action=pastebin&id=1562

Does somebody know what the problem is with my code? Why clients can’t connect to the server? (UPnP is enabled on my router)

Thank you :slight_smile:

Verify that [icode]InetAddress.getLocalHost().getHostAddress()[/icode] actually returns the IP address of the NIC connected to your internet gateway router. In the case where you have multiple physical and logical/virtual NICs, this is not always the case.
See this SO thread for a way to determine the IP address of the NIC connected to your UPnP NAT and through which you want your clients to reach your server.