Class: Nonnative::ChaosProxy

Inherits:
Proxy
  • Object
show all
Defined in:
lib/nonnative/chaos_proxy.rb

Instance Method Summary collapse

Methods inherited from Proxy

#initialize

Constructor Details

This class inherits a constructor from Nonnative::Proxy

Instance Method Details

#portObject



15
16
17
# File 'lib/nonnative/chaos_proxy.rb', line 15

def port
  service.proxy.port
end

#startObject



5
6
7
8
# File 'lib/nonnative/chaos_proxy.rb', line 5

def start
  @tcp_server = ::TCPServer.new('0.0.0.0', service.port)
  @thread = Thread.new { perform_start }
end

#stopObject



10
11
12
13
# File 'lib/nonnative/chaos_proxy.rb', line 10

def stop
  thread.terminate
  tcp_server.close
end