Sha256: 40cf811184b746c54395b3222692d0e6ab25dab95f78b0bcadb3ebad531bc595

Contents?: true

Size: 159 Bytes

Versions: 5

Compression:

Stored size: 159 Bytes

Contents

require 'socket'

module Handler

  def open_port(host, port)
    s = TCPSocket.open(host, port)
    s.close
    true
  rescue Exception
    false
  end
  
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
xinuc-sermont-0.2.5 lib/handler/open_port.rb
xinuc-sermont-0.2.6 lib/handler/open_port.rb
xinuc-sermont-0.3.0 lib/handler/open_port.rb
xinuc-sermont-0.3.1 lib/handler/open_port.rb
sermont-0.3.3 lib/handler/open_port.rb