From: Toby Dipasquale Date: 2007-04-23T10:54:35+09:00 Subject: Re: Timeout errors using Net::HTTP on Windows Emilio Tagua wrote: > On 4/17/07, Toby DiPasquale wrote: >> from put_client.rb:25:in `upload_file' >> uri = URI.parse url >> else >> end >> require 'webrick' >> s.mount("/", PutServlet) >> Any ideas? Thanks. > You could try something like: > def method > begin > response = Timeout::timeout(5) { Net::(whatever u want from NET > Class) } > ... > rescue Timeout::Error > puts 'Timeout!!!' > .... > end > end > > Hope it helps you! This would not help as the problem it the use of the timeout module in the first place. The net/protocol module already wraps the call in a Timeout::timeout() call and this is the source of the issue. That call spawns a Ruby thread to enforce the timeout and the combination of the thread use and I/O is what is triggering the problem. In any case, I've already rewritten the code in Python and it works fine on all platforms. Thanks anyway. -- Toby DiPasquale -- Posted via http://www.ruby-forum.com/.