Hi List,
I'm using net/http module to connect to a list of hosts.
How can I force to connect to next host of the list after a timeout?
http.open_timeout = timeout
http.read_timeout = timeout
This doesn't works! 
Thank you list,
Al
···
--
Posted via http://www.ruby-forum.com/.
Alfonso Caponi wrote:
Hi List,
I'm using net/http module to connect to a list of hosts.
How can I force to connect to next host of the list after a timeout?
http.open_timeout = timeout
http.read_timeout = timeout
This doesn't works! 
Thank you list,
Al
If the problem is that it stalls in DNS resolution then
require 'resolv-replace' might help.
Surrounding your call with
require 'timeout'
begin
Timeout::timeout(seconds_to_timeout) { call here } # might work.
rescue Timeout::Error
end
-R
···
--
Posted via http://www.ruby-forum.com/\.