From: Saynatkari Date: 2005-04-03T10:00:34+09:00 Subject: Re: Handling Timeout::Error from TCPSocket Pat Maddox wrote: > Alright, I'm understanding it more. > > If I use timeout, am I still able to catch the SocketErrors that might > occur? I'd like to be able to differentiate between a host > unreachable, connection refused, and a time out. Refused would happen > before the timeout(), but I'm not sure that the other two would even > get thrown. Does timeout() just kill whatever's going on at the time? You can handle those within the timeout loop. If you want to concentrate the error handling, you should be able to just add a few more rescue clauses where TimeoutError is rescued. > Sorry it's taking me a bit, but I really appreciate all the help. > > > > On Apr 2, 2005 4:02 PM, Glenn Parker wrote: > >>Pat Maddox wrote: >> >>>I'm going to be running this test every minute. If it takes two >>>minutes to time out, that doesn't do me any good. >> >>Then just attempt a single connection and bag it after your desired >>total timeout. In essence, it's already retrying internally (resending >>SYN packets) so you're just adding overhead without getting any benefit. >> >>-- >>Glenn Parker | glenn.parker-AT-comcast.net | E