Yes, I'd do something like:
if(!connect(20,1234))throw FailMiserablyException();
public static boolean connect(int tries, final int port)....
try{
final Socket s = new Socket();
s.connect(new InetSocketAddress(addr, port), 150);
} catch (IOException e) {
if (tries < 1) {
return false;
} else {
try {
Thread.sleep(100);
} catch (InterruptedException e1) {
return false;
}
return connect(--tries, port);
}
}
...
--
View this message in context:
http://openejb.979440.n4.nabble.com/Sleep-10s-tp4666479p4666486.html
Sent from the OpenEJB Dev mailing list archive at Nabble.com.