lib/ridley/host_commander.rb
# Checks to see if the given port is open for TCP connections
# on the given host.
#
# @param [String] host
#   the host to attempt to connect to
# @param [Fixnum] port
#   the port to attempt to connect on
# @param [Float] wait_time ({PORT_CHECK_TIMEOUT})
#   the number of seconds to wait
#
# @return [Boolean]
Checks to see if the given port is open for TCP connections
on the given host.
Checks to see if the given port is open for TCP connections on the given host .
def connector_port_open?(host, port, wait_time = nil)
        defer {
          timeout(wait_time || PORT_CHECK_TIMEOUT) { Celluloid::IO::TCPSocket.new(host, port).close; true }
        }
      rescue Timeout::Error, SocketError, Errno::ECONNREFUSED, Errno::EHOSTUNREACH, Errno::EADDRNOTAVAIL => ex
        false
      end
def connector_port_open? ( host , port , wait_time = nil ) defer { timeout ( wait_time || PORT_CHECK_TIMEOUT ) { Celluloid :: IO :: TCPSocket . new ( host , port ) . close ; true } } rescue Timeout :: Error , SocketError , Errno :: ECONNREFUSED , Errno :: EHOSTUNREACH , Errno :: EADDRNOTAVAIL => ex false end
Checks to see if the given port is open for TCP connections
on the given host.
Checks to see if the given port is open for TCP connections on the given host .
None
Boolean
host
<not_specific>
port
<not_specific>
wait_time
<not_specific>
<not_specific>
wait_time ({PORT_CHECK_TIMEOUT}) the number of seconds to wait
wait_time ( { PORT_CHECK_TIMEOUT } ) the number of seconds to wait