From: "André" Date: 2007-12-14T01:25:03+09:00 Subject: Re: Ruby/Gnome app hangs when http'ing from inside a thread (linux only) Anyone? André On Dec 12, 4:01 pm, "André" wrote: > Hello, > > I'm writing a Ruby/Gnome application that auto-updates itself from the > internet when a new version is available. > > The auto-update function runs in a different thread, so the user won't > even notice that the application is checking for a new version. > > It all works fine, EXCEPT when there's no network connection. In this > case, the WHOLE application simply hangs for one or two minutes, with > no regard for the fact that this code is running in a thread, or that > the timeout property is set. > > And this error only happens on linux. Has anybody ever experienced > anything like it? > > A sample code follows: > > Thread.new do > http = Net::HTTP.new('myhost.com') > http.open_timeout = 5 > http.read_timeout = 5 > http.start > resp = http.get('/somefile.html') > puts resp.body > end > > André