Sha256: 47cb4179806d27272ee7b2442adacc17c135b6d7b32a4e2df51a8a1845d6ee58
Contents?: true
Size: 440 Bytes
Versions: 26
Compression:
Stored size: 440 Bytes
Contents
require 'socket' require 'timeout' module Veewee class Utils def self.is_port_open?(ip, port) begin Timeout::timeout(1) do begin s = TCPSocket.new(ip, port) s.close return true rescue Errno::ECONNREFUSED, Errno::EHOSTUNREACH return false end end rescue Timeout::Error end return false end end #Class end #Module
Version data entries
26 entries across 26 versions & 2 rubygems