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
-
#host ⇒ Object
Returns the value of attribute host.
-
#port ⇒ Object
Returns the value of attribute port.
Instance Method Summary collapse
-
#addr_to_s ⇒ Object
This method returns a printable address and optional port associated with the host that triggered the exception.
- #initialize(addr = nil, port = nil) ⇒ Object
Instance Attribute Details
#host ⇒ Object
Returns the value of attribute host.
168 169 170 |
# File 'lib/rex/exceptions.rb', line 168 def host @host end |
#port ⇒ Object
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_s ⇒ Object
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 |