From: Ruby Nuby Date: 2009-09-23T03:59:09+09:00 Subject: Re: Can't use a timeout with Socket::getaddrinfo Joel VanderWerf wrote: > Ruby Nuby wrote: >> begin >> seconds, then reaches the rescue. I'd like to know why the rescue code >> is being reached if the timeout of 2 seconds isn't being used. Also, is >> there a way for me to correctly implement a timeout on >> Socket:getaddrinfo? >> >> Thanks in advance, fellow Rubyists. > > Try resolv.rb in the standard library? Awesome. Resolv.getname(ip).. Thanks. I didn't realize it was going to be that easy. I assumed there were lower level socket options that needed to be set. Resolv.getname works well with timeouts. I appreciate the feedback. -- Posted via http://www.ruby-forum.com/.