Module: Rex::HostCommunicationError

Included in:
AddressInUse, ConnectionError
Defined in:
lib/rex/exceptions.rb

Overview

This exception is raised when there is some kind of error related to communication with a host.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#hostObject

Returns the value of attribute host.



168
169
170
# File 'lib/rex/exceptions.rb', line 168

def host
  @host
end

#portObject

Returns the value of attribute port.



168
169
170
# File 'lib/rex/exceptions.rb', line 168

def port
  @port
end

Instance Method Details

#addr_to_sObject

This method returns a printable address and optional port associated with the host that triggered the exception.



158
159
160
161
162
163
164
165
166
# File 'lib/rex/exceptions.rb', line 158

def addr_to_s
	if host and port
		"(#{host}:#{port})"
	elsif host
		"(#{host})"
	else
		""
	end
end

#initialize(addr = nil, port = nil) ⇒ Object



149
150
151
152
# File 'lib/rex/exceptions.rb', line 149

def initialize(addr = nil, port = nil)
	self.host = addr
	self.port = port
end