Class: Msf::Aggregator::Forwarder
- Inherits:
-
Object
- Object
- Msf::Aggregator::Forwarder
- Defined in:
- lib/msf/aggregator/forwarder.rb
Direct Known Subclasses
Constant Summary collapse
- CONNECTION_TIMEOUT =
one minute
60
Instance Attribute Summary collapse
-
#log_messages ⇒ Object
Returns the value of attribute log_messages.
-
#response_queues ⇒ Object
readonly
Returns the value of attribute response_queues.
Instance Method Summary collapse
- #connections ⇒ Object
-
#forward(connection) ⇒ Object
stub for indexing.
-
#initialize ⇒ Forwarder
constructor
A new instance of Forwarder.
Constructor Details
#initialize ⇒ Forwarder
Returns a new instance of Forwarder.
9 10 11 12 13 14 15 |
# File 'lib/msf/aggregator/forwarder.rb', line 9 def initialize = false @response_queues = {} @responding_threads = {} @forwarder_mutex = Mutex.new @router = Router.instance end |
Instance Attribute Details
#log_messages ⇒ Object
Returns the value of attribute log_messages.
6 7 8 |
# File 'lib/msf/aggregator/forwarder.rb', line 6 def end |
#response_queues ⇒ Object (readonly)
Returns the value of attribute response_queues.
7 8 9 |
# File 'lib/msf/aggregator/forwarder.rb', line 7 def response_queues @response_queues end |
Instance Method Details
#connections ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/msf/aggregator/forwarder.rb', line 22 def connections # TODO: for now before reporting connections flush stale ones flush_stale_sessions connections = {} @response_queues.each_pair do |connection, queue| forward = 'parked' host, port = @router.get_forward(connection) unless host.nil? forward = "#{host}:#{port}" end connections[connection] = forward end connections end |
#forward(connection) ⇒ Object
stub for indexing
18 19 20 |
# File 'lib/msf/aggregator/forwarder.rb', line 18 def forward(connection) end |