Method: Msf::RPC::JSON::DispatcherHelper#get_dispatcher

Defined in:
lib/msf/core/rpc/json/dispatcher_helper.rb

#get_dispatcher(dispatchers, version, framework) ⇒ Msf::RPC::JSON::Dispatcher

Get an RPC Dispatcher for the RPC version. Creates a new instance and stores it in the dispatchers hash if one does not already exist for the version.

Parameters:

  • dispatchers (Hash)

    hash of version Symbol - Msf::RPC::JSON::Dispatcher object pairs

  • version (Symbol)

    the RPC version

  • framework (Msf::Simple::Framework)

    Framework wrapper instance

Returns:



10
11
12
13
14
15
16
# File 'lib/msf/core/rpc/json/dispatcher_helper.rb', line 10

def get_dispatcher(dispatchers, version, framework)
  unless dispatchers.key?(version)
    dispatchers[version] = create_dispatcher(version, framework)
  end

  dispatchers[version]
end