From: Joseph McDonald Date: 2002-01-25T04:44:21+09:00 Subject: filedescriptors not returned to the system Hi, The following code eats up file descriptors like crazy. The .05 timeout is there just to show the problem. Does anyone know how to fix this so that filedescriptors don't get all used up? I would have thought the s.close would have solved the problem, but it doesn't. #!/usr/local/bin/ruby require 'timeout' require 'socket' s = "" while true begin timeout(.05) do s = TCPSocket.new("www.cnn.com", 80) puts s.type end rescue $stderr.puts "failed #{$!}... retrying" s.close if s.type == TCPSocket # system("pstat -T") retry end end thanks, -joe