def blank_socket
      sock = ::Socket.new(::Socket::AF_INET, ::Socket::SOCK_STREAM, 0)

      # close file descriptors if we exec
      sock.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC)

      # Disable Nagle's algorithm
      sock.setsockopt(::Socket::IPPROTO_TCP, ::Socket::TCP_NODELAY, 1)

      if using_keepalive? then
        sock.setsockopt( ::Socket::SOL_SOCKET, ::Socket::SO_KEEPALIVE , true )
        sock.setsockopt( ::Socket::SOL_TCP,    ::Socket::TCP_KEEPIDLE , keepalive_idle )
        sock.setsockopt( ::Socket::SOL_TCP,    ::Socket::TCP_KEEPINTVL, keepalive_interval)
        sock.setsockopt( ::Socket::SOL_TCP,    ::Socket::TCP_KEEPCNT  , keepalive_count)
      end

      return sock
    end
def blank_socket
      sock = ::Socket.new(::Socket::AF_INET, ::Socket::SOCK_STREAM, 0)

      # close file descriptors if we exec
      sock.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC)

      # Disable Nagle's algorithm
      sock.setsockopt(::Socket::IPPROTO_TCP, ::Socket::TCP_NODELAY, 1)

      if using_keepalive? then
        sock.setsockopt( ::Socket::SOL_SOCKET, ::Socket::SO_KEEPALIVE , true )
        sock.setsockopt( ::Socket::SOL_TCP,    ::Socket::TCP_KEEPIDLE , keepalive_idle )
        sock.setsockopt( ::Socket::SOL_TCP,    ::Socket::TCP_KEEPINTVL, keepalive_interval)
        sock.setsockopt( ::Socket::SOL_TCP,    ::Socket::TCP_KEEPCNT  , keepalive_count)
      end

      return sock
    end
Internal: Low level socket allocation and option configuration

 Using the options from the initializer, a new ::Socket is created that
 is:

   TCP, IPv4 only, autoclosing on exit, nagle's algorithm is disabled and has
   TCP Keepalive options set if keepalive is supported.

 Returns a new ::Socket instance