STDOUT.sync = true require "net/ftp" root = "tgftp.nws.noaa.gov" total = 0 run = true puts ">> Probing max connections for: #{root}" while run do begin print "." ftp = Net::FTP.new root ftp.passive ftp.debug_mode ftp.login rescue EOFError, Net::FTPTempError run = false else total += 1 end end puts "\n>> Total connections: #{total}"