well,i made an tic tac toe online app to see if i really understood sockets or not and it works fine,i tested it with pcs in my network.
then i wanted to use the client side code on any other pc outside my network while the server is running on my pc
so i port forwarded to my pc and tested it, it doesn't let the other player to connect, only the first player can connect,
i tried to let the first player connect with the ip address of the router and the other one connects from my pc using 127.0.0.1(localhost)
it works just for the first game, if the user choses to play again after the game ends it doesn't let the player (that uses ip address of the router to connect again).
i made sure that i close all sockets before window closes.