    # File lib/mongrel.rb, line 259
        def run
          BasicSocket.do_not_reverse_lookup=true

          configure_socket_options

          if defined?($tcp_defer_accept_opts) and $tcp_defer_accept_opts
            @socket.setsockopt(*$tcp_defer_accept_opts) rescue nil
          end

          @acceptor = Thread.new do
            begin
              while true
                begin
                  client = @socket.accept

                  if defined?($tcp_cork_opts) and $tcp_cork_opts
                    client.setsockopt(*$tcp_cork_opts) rescue nil
                  end

                  worker_list = @workers.list

                  if worker_list.length >= @num_processors
                    STDERR.puts "Server overloaded with #{worker_list.length} processors (#@num_processors max). Dropping connection."
                    client.close rescue nil
                    reap_dead_workers("max processors")
                  else
                    thread = Thread.new(client) {|c| process_client(c) }
                    thread[:started_on] = Time.now
                    @workers.add(thread)

                    sleep @throttle if @throttle > 0
                  end
                rescue StopServer
                  break
                rescue Errno::EMFILE
                  reap_dead_workers("too many open files")
                  sleep 0.5
                rescue Errno::ECONNABORTED
                  # client closed the socket even before accept
                  client.close rescue nil
                rescue Object => e
                  STDERR.puts "#{Time.now}: Unhandled listen loop exception #{e.inspect}."
                  STDERR.puts e.backtrace.join("\n")
                end
              end
              graceful_shutdown
            ensure
              @socket.close
              # STDERR.puts "#{Time.now}: Closed socket."
            end
          end

          return @acceptor
        end