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.
Instance Attribute Summary collapse
-
#listener ⇒ Object
readonly
Returns the value of attribute listener.
-
#name ⇒ Object
readonly
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
readonly
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.
74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/rex/services/local_relay.rb', line 74 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.
101 102 103 |
# File 'lib/rex/services/local_relay.rb', line 101 def listener @listener end |
#name ⇒ Object
Returns the value of attribute name.
101 102 103 |
# File 'lib/rex/services/local_relay.rb', line 101 def name @name end |
#on_conn_close_proc ⇒ Object
Returns the value of attribute on_conn_close_proc.
103 104 105 |
# File 'lib/rex/services/local_relay.rb', line 103 def on_conn_close_proc @on_conn_close_proc end |
#on_local_connection_proc ⇒ Object
Returns the value of attribute on_local_connection_proc.
102 103 104 |
# File 'lib/rex/services/local_relay.rb', line 102 def on_local_connection_proc @on_local_connection_proc end |
#on_other_data_proc ⇒ Object
Returns the value of attribute on_other_data_proc.
104 105 106 |
# File 'lib/rex/services/local_relay.rb', line 104 def on_other_data_proc @on_other_data_proc end |
#opts ⇒ Object
Returns the value of attribute opts.
101 102 103 |
# File 'lib/rex/services/local_relay.rb', line 101 def opts @opts end |
Instance Method Details
#close ⇒ Object
93 94 95 96 97 98 99 |
# File 'lib/rex/services/local_relay.rb', line 93 def close begin listener.close if (listener) rescue ::Exception end listener = nil end |
#shutdown ⇒ Object
86 87 88 89 90 91 |
# File 'lib/rex/services/local_relay.rb', line 86 def shutdown begin listener.shutdown if (listener) rescue ::Exception end end |