def tcp_socket_request
      Timeout.timeout(request_timeout) do
        s = TCPSocket.new(host, port)
        s.close
      end
    rescue Errno::ECONNREFUSED => e
      addl_message = "#{host} is not accepting connections on port #{port}: "
      raise ConnectionFailed, addl_message + e.message
    rescue SocketError => e
      addl_message = "connection to #{host} on port #{port} failed with '#{e.message}': "
      raise ConnectionFailed, addl_message + e.message
    rescue Timeout::Error => e
      addl_message = "#{host} did not respond on port #{port} within #{request_timeout} seconds: "
      raise ConnectionFailed, addl_message + e.message
    rescue => e
      raise ConnectionFailed, e
    end
def tcp_socket_request
      Timeout.timeout(request_timeout) do
        s = TCPSocket.new(host, port)
        s.close
      end
    rescue Errno::ECONNREFUSED => e
      addl_message = "#{host} is not accepting connections on port #{port}: "
      raise ConnectionFailed, addl_message + e.message
    rescue SocketError => e
      addl_message = "connection to #{host} on port #{port} failed with '#{e.message}': "
      raise ConnectionFailed, addl_message + e.message
    rescue Timeout::Error => e
      addl_message = "#{host} did not respond on port #{port} within #{request_timeout} seconds: "
      raise ConnectionFailed, addl_message + e.message
    rescue => e
      raise ConnectionFailed, e
    end
Returns true if the request was successful.
 Otherwise raises a PingCheck::ConnectionFailed error.