class Devup::PortChecker

Public Instance Methods

call(port) click to toggle source
# File lib/devup/port_checker.rb, line 6
def call(port)
  s = TCPSocket.new("0.0.0.0", port)
  s.write "1"
  s.close

  true
rescue Errno::ECONNREFUSED, Errno::EHOSTUNREACH
  false
end