Class: FFWD::UDP::SetupInput

Inherits:
Object
  • Object
show all
Defined in:
lib/ffwd/protocol/udp.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config, log, connection) ⇒ SetupInput

Returns a new instance of SetupInput.



51
52
53
54
55
# File 'lib/ffwd/protocol/udp.rb', line 51

def initialize config, log, connection
  @config = config
  @log = log
  @connection = connection
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



49
50
51
# File 'lib/ffwd/protocol/udp.rb', line 49

def config
  @config
end

Instance Method Details

#bind(core) ⇒ Object



57
58
59
60
61
62
# File 'lib/ffwd/protocol/udp.rb', line 57

def bind core
  raise "Missing required key :host" if (host = @config[:host]).nil?
  raise "Missing required key :port" if (port = @config[:port]).nil?
  @config = Bind.prepare Hash[@config]
  Bind.new core, @log, host, port, @connection, @config
end

#tunnel(core, plugin) ⇒ Object



64
65
66
67
# File 'lib/ffwd/protocol/udp.rb', line 64

def tunnel core, plugin
  raise "Missing required key :port" if (port = @config[:port]).nil?
  FFWD::Tunnel::UDP.new port, core, plugin, @log, @connection, @config
end