Hi .. On Wednesday 09 February 2005 11:32, Gennady Bystritksy wrote: > Have you tried to move your TCPSocket.new clause inside begin/rescue/end > block? > Yes. The close() in the ensure is then out of scope. Moving it into the begin .. block like def alive(host, port=80) s = "host=#{host} : " begin t = TCPSocket.new(host, port) s << " made it!" return s t.close rescue Errno::ETIMEDOUT s << " Timed out -- node unreachable" rescue Exception => e s << " exception = #{e}" end end Regards, -- -mark. (probertm at acm dot org)