Skip to content

Instantly share code, notes, and snippets.

@elskwid
Forked from supernullset/probe.rb
Created September 6, 2012 05:57
Show Gist options
  • Save elskwid/3651871 to your computer and use it in GitHub Desktop.
Save elskwid/3651871 to your computer and use it in GitHub Desktop.
Weird net/ftp behavior
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}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment