Method: Arachni::Processes::Dispatchers#spawn
- Defined in:
- lib/arachni/processes/dispatchers.rb
#spawn(options = {}) ⇒ RPC::Client::Dispatcher
Spawns a RPC::Server::Dispatcher process.
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/arachni/processes/dispatchers.rb', line 66 def spawn( = {} ) fork = .delete(:fork) = { dispatcher: { neighbour: [:neighbour], node_pipe_id: [:pipe_id], node_weight: [:weight], external_address: [:external_address], pool_size: [:pool_size] }, rpc: { server_port: [:port] || available_port, server_address: [:address] || '127.0.0.1' } } Manager.spawn( :dispatcher, options: , fork: fork ) url = "#{[:rpc][:server_address]}:#{[:rpc][:server_port]}" while sleep( 0.1 ) begin connect( url, connection_pool_size: 1, max_retries: 1 ).alive? break rescue => e # ap e end end @list << url connect( url, fresh: true ) end |