Sha256: 209aa923352c64eb2f9199d5658a7194c84e48358d19d18a6aaf03f90a6e6053

Contents?: true

Size: 839 Bytes

Versions: 43

Compression:

Stored size: 839 Bytes

Contents

require 'rex'
require 'rex/proto'

module Rex

###
#
# The service module is used to extend classes that are passed into the
# service manager start routine.  It provides extra methods, such as reference
# counting, that are used to track the service instances more uniformly.
#
###
module Service
	include Ref

	require 'rex/services/local_relay'

	#
	# Returns the hardcore, as in porno, alias for this service.  This is used
	# by the service manager to manage singleton services.
	#
	def self.hardcore_alias(*args)
		return "__#{args}"
	end

	def deref
		rv = super

		# If there's only one reference, then it's the service managers.
		if @_references == 1
			Rex::ServiceManager.stop_service(self)
		end

		rv
	end

	#
	# Calls stop on the service once the ref count drops.
	#
	def cleanup
		stop
	end

	attr_accessor :alias

end

end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
librex-0.0.65 lib/rex/service.rb
librex-0.0.63 lib/rex/service.rb
librex-0.0.54 lib/rex/service.rb
librex-0.0.53 lib/rex/service.rb
librex-0.0.52 lib/rex/service.rb
librex-0.0.51 lib/rex/service.rb
librex-0.0.50 lib/rex/service.rb
librex-0.0.49 lib/rex/service.rb
librex-0.0.48 lib/rex/service.rb
librex-0.0.47 lib/rex/service.rb
librex-0.0.46 lib/rex/service.rb
librex-0.0.44 lib/rex/service.rb
librex-0.0.43 lib/rex/service.rb
librex-0.0.42 lib/rex/service.rb
librex-0.0.41 lib/rex/service.rb
librex-0.0.40 lib/rex/service.rb
librex-0.0.39 lib/rex/service.rb
librex-0.0.38 lib/rex/service.rb
librex-0.0.37 lib/rex/service.rb
librex-0.0.36 lib/rex/service.rb