From: Ville Mattila Date: 2005-01-24T20:05:52+09:00 Subject: Re: TCPSocket.new blocks other threads "christoph.heindl@gmail.com" writes: > thanks for your reply. > however, as i pointed out in my initial post, the problem only occurs > on windows. I searched for the problem for quite a while and it seems > that ruby uses Winsock on Windows (instead of Winsock2). Somehow ruby's > scheduler seems not to be able to schedule other threads during a > TCPSocket connection attempt. I think this is not a ruby problem in > general, but has todo with ruby + winsock. > Maybe there are any patches around? Hello, works fine with me (windows 2000 + SP4 and all security patches) .... > type foo.rb require "socket" Thread.abort_on_exception= true Thread.new { sleep 1 begin TCPSocket.new("xxx.nonexisting.xxx", 1234) rescue end puts "done" } loop { puts "." sleep 0.25 } c:\data\ruby\bin\ruby -v foo.rb ruby 1.8.2 (2005-01-19) [i386-mswin32] .. .. .. .. done .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. foo.rb:16:in `sleep': Interrupt from foo.rb:16 from foo.rb:14:in `loop' from foo.rb:14 - Ville