Class: Rex::Services::LocalRelay::Relay
- Inherits:
-
Object
- Object
- Rex::Services::LocalRelay::Relay
- Defined in:
- lib/rex/services/local_relay.rb
Overview
This class acts as an instance of a given local relay.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#listener ⇒ Object
Returns the value of attribute listener.
-
#name ⇒ Object
Returns the value of attribute name.
-
#on_conn_close_proc ⇒ Object
Returns the value of attribute on_conn_close_proc.
-
#on_local_connection_proc ⇒ Object
Returns the value of attribute on_local_connection_proc.
-
#on_other_data_proc ⇒ Object
Returns the value of attribute on_other_data_proc.
-
#opts ⇒ Object
Returns the value of attribute opts.
Instance Method Summary collapse
- #close ⇒ Object
-
#initialize(name, listener, opts = {}) ⇒ Relay
constructor
A new instance of Relay.
- #shutdown ⇒ Object
Constructor Details
#initialize(name, listener, opts = {}) ⇒ Relay
Returns a new instance of Relay.
72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/rex/services/local_relay.rb', line 72 def initialize(name, listener, opts = {}) self.name = name self.listener = listener self.opts = opts self.on_local_connection_proc = opts['OnLocalConnection'] self.on_conn_close_proc = opts['OnConnectionClose'] self.on_other_data_proc = opts['OnOtherData'] if (not $dispatcher['rex']) register_log_source('rex', $dispatcher['core'], get_log_level('core')) end end |
Instance Attribute Details
#listener ⇒ Object
Returns the value of attribute listener.
99 100 101 |
# File 'lib/rex/services/local_relay.rb', line 99 def listener @listener end |
#name ⇒ Object
Returns the value of attribute name.
99 100 101 |
# File 'lib/rex/services/local_relay.rb', line 99 def name @name end |
#on_conn_close_proc ⇒ Object
Returns the value of attribute on_conn_close_proc.
101 102 103 |
# File 'lib/rex/services/local_relay.rb', line 101 def on_conn_close_proc @on_conn_close_proc end |
#on_local_connection_proc ⇒ Object
Returns the value of attribute on_local_connection_proc.
100 101 102 |
# File 'lib/rex/services/local_relay.rb', line 100 def on_local_connection_proc @on_local_connection_proc end |
#on_other_data_proc ⇒ Object
Returns the value of attribute on_other_data_proc.
102 103 104 |
# File 'lib/rex/services/local_relay.rb', line 102 def on_other_data_proc @on_other_data_proc end |
#opts ⇒ Object
Returns the value of attribute opts.
99 100 101 |
# File 'lib/rex/services/local_relay.rb', line 99 def opts @opts end |
Instance Method Details
#close ⇒ Object
91 92 93 94 95 96 97 |
# File 'lib/rex/services/local_relay.rb', line 91 def close begin listener.close if listener rescue ::Exception end listener = nil end |
#shutdown ⇒ Object
84 85 86 87 88 89 |
# File 'lib/rex/services/local_relay.rb', line 84 def shutdown begin listener.shutdown if listener rescue ::Exception end end |