Methods

VCR::Ping

Public Class Methods

pingecho(host, timeout=5, service="echo") click to toggle source
# File lib/vcr/util/ping.rb, line 14
def pingecho(host, timeout=5, service="echo")
  begin
    timeout(timeout) do
      s = TCPSocket.new(host, service)
      s.close
    end
  rescue Errno::ECONNREFUSED
    return true
  rescue Timeout::Error, StandardError
    return false
  end
  return true
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.