From: Michael Kircher Date: 2001-10-26T22:52:34+09:00 Subject: [ruby-talk:23445] TCP Socket and timeout problem Hi I have a small piece of code which tries to connect to a server. It keeps trying, even if the server is not available. With Ruby 1.6.4 on Windows 2000 I get a deadlock at iteration 180. Any ideas? Thanks, Michael P.S.: Matz, we talked at OOPSLA briefly about this. Do you remember? @obervable = 139.23.189.51 client=nil counter=0 while client==nil begin counter+=1 puts "Trying (#{@observable}:9000).. #{counter} times" timeout (3) do client = TCPSocket.new(@observable, 9000) end rescue TimeoutError puts ".. connect failed" client=nil end end puts ".. connected."