From: Mark Hahn Date: 2001-12-31T01:38:35+09:00 Subject: [ruby-talk:29729] Re: http timeout? > Sould I set timeout limit by default? Yes. A call that never returns is a bad thing. The timeouts you suggested would be great. Using only pickaxe, I had no way of knowing about the timeout methods. For some reason the Protocol module is not documented. Can you answer my question about what happens to a socket when the thread is killed? ----- Original Message ----- From: "Minero Aoki" To: "ruby-talk ML" Sent: Sunday, December 30, 2001 2:24 AM Subject: [ruby-talk:29714] Re: http timeout? > > In mail "[ruby-talk:29678] http timeout?" > "Mark Hahn" wrote: > > > If I try to connect to an http server with Net::HTTP.new().get and the > > server doesn't respond, the get call never returns (I've waited 3 minutes). > > Shouldn't there be a timeout? > > Try this: > > http = Net::HTTP.new(host,port) > http.open_timeout = 30 # secs > http.read_timeout = 60 # secs > .... > > Sould I set timeout limit by default? > > -- Minero Aoki >