wood burning stoves 2.0*
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 OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "problem with sockets :S" Watch "problem with sockets :S" New topic
Author

problem with sockets :S

Abdelrahman Hatem
Greenhorn

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 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.
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem with sockets :S