Class: FFWD::TCP::SetupInput

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config, log, connection) ⇒ SetupInput

Returns a new instance of SetupInput.



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

def initialize config, log, connection
  @config = Hash[config]
  @log = log
  @connection = connection
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



61
62
63
# File 'lib/ffwd/protocol/tcp.rb', line 61

def config
  @config
end

Instance Method Details

#bind(core) ⇒ Object



69
70
71
72
73
74
# File 'lib/ffwd/protocol/tcp.rb', line 69

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

#tunnel(core, plugin) ⇒ Object



76
77
78
79
# File 'lib/ffwd/protocol/tcp.rb', line 76

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