Sha256: 0b16f50b90f4e8a2d067e8353f69df81e215e80cdef5278e1fdf0f8589fd96e0

Contents?: true

Size: 716 Bytes

Versions: 55

Compression:

Stored size: 716 Bytes

Contents

##
# A Gem::Net::HTTP connection wrapper that holds extra information for managing the
# connection's lifetime.

class Gem::Net::HTTP::Persistent::Connection # :nodoc:

  attr_accessor :http

  attr_accessor :last_use

  attr_accessor :requests

  attr_accessor :ssl_generation

  def initialize http_class, http_args, ssl_generation
    @http           = http_class.new(*http_args)
    @ssl_generation = ssl_generation

    reset
  end

  def finish
    @http.finish
  rescue IOError
  ensure
    reset
  end
  alias_method :close, :finish

  def reset
    @last_use = Gem::Net::HTTP::Persistent::EPOCH
    @requests = 0
  end

  def ressl ssl_generation
    @ssl_generation = ssl_generation

    finish
  end

end

Version data entries

55 entries across 55 versions & 3 rubygems

Version Path
rubygems-update-3.6.3 bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb
bundler-2.6.3 lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb
minato_ruby_api_client-0.2.2 vendor/bundle/ruby/3.2.0/gems/bundler-2.5.5/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb
rubygems-update-3.6.2 bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb
bundler-2.6.2 lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb
rubygems-update-3.6.1 bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb
bundler-2.6.1 lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb
rubygems-update-3.6.0 bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb
bundler-2.6.0 lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb
rubygems-update-3.5.23 bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb
bundler-2.5.23 lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb
rubygems-update-3.5.22 bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb
bundler-2.5.22 lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb
rubygems-update-3.5.21 bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb
bundler-2.5.21 lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb
rubygems-update-3.5.20 bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb
bundler-2.5.20 lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb
rubygems-update-3.5.19 bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb
bundler-2.5.19 lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb
rubygems-update-3.5.18 bundler/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent/connection.rb