def using_keepalive?
      using = false
      if keepalive_active? then
        using = [ :SOL_SOCKET, :SO_KEEPALIVE, :SOL_TCP, :TCP_KEEPIDLE, :TCP_KEEPINTVL, :TCP_KEEPCNT].all? do |c|
          ::Socket.const_defined? c
        end
      end
      return using
    end
def using_keepalive?
      using = false
      if keepalive_active? then
        using = [ :SOL_SOCKET, :SO_KEEPALIVE, :SOL_TCP, :TCP_KEEPIDLE, :TCP_KEEPINTVL, :TCP_KEEPCNT].all? do |c|
          ::Socket.const_defined? c
        end
      end
      return using
    end
Internal: say if we are using TCP Keep Alive or not

 We will return true if the initialization options :keepalive_active is
 set to true, and if all the constants that are necessary to use TCP keep
 alive are defined.

 It may be the case that on some operating systems that the constants are
 not defined, so in that case we do not want to attempt to use tcp keep
 alive if we are unable to do so in any case.

 Returns true or false