This week's book giveaway is in the Agile forum.
We're giving away four copies of The Software Craftsman and have Sandro Mancuso on-line!
See this thread for details.
The moose likes Sockets and Internet Protocols and the fly likes problem with sockets :S Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Software Craftsman this week in the Agile forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "problem with sockets :S" Watch "problem with sockets :S" New topic

problem with sockets :S

Abdelrahman Hatem

Joined: Sep 07, 2010
Posts: 10
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
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.
Wouter Oet
Saloon Keeper

Joined: Oct 25, 2008
Posts: 2700

Please UseAMeaningfulSubjectLine. Did you close your ServerSocket? Why can't he reconnect? What happens then? Please TellTheDetails and without some code we're just guessing.

"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
Have you tried LearnNowOnline?
subject: problem with sockets :S