# File lib/ruby-debug.rb, line 117
    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 # Mac OS X seems to have problem with 'localhost'
            host ||= 'localhost' # nil does not seem to work for IPv6, localhost does
          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