Class: LogicalConstruct::SSHTunnel::OpenPortTask

Inherits:
Mattock::Rake::Task
  • Object
show all
Defined in:
lib/logical-construct/protocol/ssh-tunnel.rb

Instance Method Summary collapse

Instance Method Details

#action(args) ⇒ Object



22
23
24
25
26
27
28
29
# File 'lib/logical-construct/protocol/ssh-tunnel.rb', line 22

def action(args)
test_server = TCPServer.new("0.0.0.0", found_port)
rescue Errno::EADDRINUSE
  self.found_port += 1
  retry
ensure
  test_server.close
end

#configure_discovery(base_port) ⇒ Object



17
18
19
20
# File 'lib/logical-construct/protocol/ssh-tunnel.rb', line 17

def configure_discovery(base_port)
  self.base_port = base_port
  return proxy_value.found_port
end

#resolve_configurationObject



12
13
14
15
# File 'lib/logical-construct/protocol/ssh-tunnel.rb', line 12

def resolve_configuration
  self.found_port = base_port
  super
end