Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
force timeout net/http
Alfonso Caponi
7/17/2008 8:23:00 AM
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-...
.
1 Answer
Roger Pack
7/18/2008 12:33:00 AM
0
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-...
.
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
force timeout net/http
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password