lib/ztk/tcp_socket_check.rb
# Wait for the socket on the host and port specified to become ready.  This
# method will timeout and return false after the amount of seconds specified
# in *config.wait* has passed if the socket has not become ready.
#
# @return [Boolean] Returns true or false depending on Whether the socket
#   became ready or not.
Wait for the socket on the host and port specified to become ready.  This
method will timeout and return false after the amount of seconds specified
in *config.wait* has passed if the socket has not become ready.
Wait for the socket on the host and port specified to become ready . This method will timeout and return false after the amount of seconds specified in * config . wait * has passed if the socket has not become ready .
def wait
      config.ui.logger.debug { "Waiting for socket to become available; timeout after #{config.wait} seconds." }
      Timeout.timeout(config.wait) do
        until ready?
          config.ui.logger.debug { "Sleeping 1 second." }
          sleep(1)
        end
      end
      true
    rescue Timeout::Error => e
      config.ui.logger.warn { "socket(#{config.host}:#{config.port}) timeout!" }
      false
    end
def wait config . ui . logger . debug { "Waiting for socket to become available; timeout after #{config.wait} seconds." } Timeout . timeout ( config . wait ) do until ready? config . ui . logger . debug { "Sleeping 1 second." } sleep ( 1 ) end end true rescue Timeout :: Error => e config . ui . logger . warn { "socket(#{config.host}:#{config.port}) timeout!" } false end
Wait for the socket on the host and port specified to become ready.
Wait for the socket on the host and port specified to become ready .
Returns true or false depending on Whether the socket became ready or not.
Returns true or false depending on Whether the socket became ready or not .
Boolean