You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomee.apache.org by Romain Manni-Bucau <rm...@gmail.com> on 2013/12/02 07:29:53 UTC

Sleep 10s?

Hi

Just read
https://github.com/apache/tomee/commit/012974d9c2c7da752a1a27ea85721eb0f72ca82f

Shouldnt it be a sleep of 200ms + retry to do 10s or more?

Re: Sleep 10s?

Posted by Thiago Veronezi <th...@veronezi.org>.
Done.
Thanks for the tips, guys!

[]s,
Thiago.



On Thu, Dec 5, 2013 at 9:28 AM, Thiago Veronezi <th...@veronezi.org> wrote:

> I didn't forget about it. :)
> I will work on it this evening.
>
> []s,
> Thiago.
> On Dec 2, 2013 3:56 AM, "AndyG" <an...@orprovision.com> wrote:
>
>> Then either close the socket in a finally or use is to test connectivity
>> more
>> before closing...
>>
>>
>>
>> --
>> View this message in context:
>> http://openejb.979440.n4.nabble.com/Sleep-10s-tp4666479p4666487.html
>> Sent from the OpenEJB Dev mailing list archive at Nabble.com.
>>
>

Re: Sleep 10s?

Posted by Thiago Veronezi <th...@veronezi.org>.
I didn't forget about it. :)
I will work on it this evening.

[]s,
Thiago.
On Dec 2, 2013 3:56 AM, "AndyG" <an...@orprovision.com> wrote:

> Then either close the socket in a finally or use is to test connectivity
> more
> before closing...
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Sleep-10s-tp4666479p4666487.html
> Sent from the OpenEJB Dev mailing list archive at Nabble.com.
>

Re: Sleep 10s?

Posted by AndyG <an...@orprovision.com>.
Then either close the socket in a finally or use is to test connectivity more
before closing...



--
View this message in context: http://openejb.979440.n4.nabble.com/Sleep-10s-tp4666479p4666487.html
Sent from the OpenEJB Dev mailing list archive at Nabble.com.

Re: Sleep 10s?

Posted by AndyG <an...@orprovision.com>.
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.