def start_control(host, port)
raise "Debugger is not started" unless started?
return if @control_thread
@control_thread = DebugThread.new do
begin
unless RUBY_PLATFORM =~ /darwin/i
host ||= 'localhost'
end
$stderr.printf "Fast Debugger (ruby-debug-ide 0.4.6) listens on #{host}:#{port}\n"
server = TCPServer.new(host, port)
while (session = server.accept)
begin
interface = RemoteInterface.new(session)
@event_processor = EventProcessor.new(interface)
ControlCommandProcessor.new(interface).process_commands
rescue StandardError, ScriptError => ex
$stderr.printf "Exception in DebugThread loop: #{ex}\n"
exit 1
end
end
rescue
$stderr.printf "Exception in DebugThread: #$!\n"
exit 2
end
end
end