From: Glenn Parker Date: 2005-04-03T07:08:25+09:00 Subject: Re: Handling Timeout::Error from TCPSocket Pat Maddox wrote: > Alright, basically this is what I want to do. > > Try to make a connection to a port, with a maximum timeout value of 3 > seconds. If it times out, try again two more times. If the port is > closed, just give up. So the second guess you made is more accurate. If you're going to be retrying the same server over and over again, you might as well let it timeout on its own instead of interrupting it prematurely just so you can start over again. However, if you were attempting connections across a list of replicated servers, stopping on the first successful connection, then this might be worth doing, but you might be better off using several threads in that case. -- Glenn Parker | glenn.parker-AT-comcast.net |