ServerSocket behind router
Hi all,
I am trying to build a simple client-server game every thing is ok when I test my program on my computer (when client connects to localhost) but when I tried to make someone connects to me it fails and I doesn't recieve any connections.
My computer is behind a router which takes a dynamic IP from my ISP but I configured the router to send incoming traffic on port I used to my computer and it works very well with port 80 (internet users can see a website on my computer) and with other ports(I tested this and I'm able to connect to my computer even from a mobile) and I have no firewalls.
I am using code like this for server
MainProgram.socket=new ServerSocket(port);
MainProgram.connection=MainProgram.socket.accept();
MainProgram.output=new ObjectOutputStream(MainProgram.connection.getOutputStream());
MainProgram.output.flush();
MainProgram.input=new ObjectInputStream(MainProgram.connection.getInputStream());
and code like this for client
MainProgram.connection=new Socket(InetAddress.getByName(ip),port);
MainProgram.output=new ObjectOutputStream(MainProgram.connection.getOutputStream());
MainProgram.output.flush();
MainProgram.input=new ObjectInputStream(MainProgram.connection.getInputStream());
any one can help?

