Sha256: 3f004fda3a365b7a775b07c5f01d625ebdcf61987264c0920448b86916f5cf76

Contents?: true

Size: 508 Bytes

Versions: 3

Compression:

Stored size: 508 Bytes

Contents

# encoding: utf-8

module HTTPkit
  module Connection
    module Status
      def close(reason = nil)
        @connection.close(reason)
      end

      def closed?
        !@connection.closed.pending?
      end

      def error?
        @connection.closed.rejected?
      end

      def network_fault?
        [Errno::ENOTCONN, Errno::ENETUNREACH]
          .include?(@connection.closed.reason)
      end

      def timeout?
        @connection.closed.reason == Errno::ETIMEDOUT
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
httpkit-0.6.0 lib/httpkit/connection/status.rb
httpkit-0.6.0.pre.5 lib/httpkit/connection/status.rb
httpkit-0.6.0.pre.3 lib/httpkit/connection/status.rb