I am very new to java and I am creating a portable network class. Everything works fine except one thing, if the client fails to connect to the server, say it is not up yet, how do I attempt another connection with a socket? do if say socket = new socket(IP, Port); loop until timeout retries reached or connected
No that does not help but thank you for helping. The problem is that when I try to reuse the socket over and over again it just skips over it after the first failed attempt. I would like to be able to attempt reconnects without having to restart the application.
Ok I see what was wrong now. It would appear that the socket was just initializing the first time and took a few seconds to start and if it failed to connect, the next time you tried to reconnect it would only look for > a second before moving on so a while loop was necessary. Thank you for your help and I will be back I am sure once I start getting into the hard parts.