# File lib/mongrel/configurator.rb, line 122
122:     def listener(options={},&blk)
123:       raise "Cannot call listener inside another listener block." if (@listener or @listener_name)
124:       ops = resolve_defaults(options)
125:       ops[:num_processors] ||= 950
126:       ops[:timeout] ||= 0
127: 
128:       @listener = Mongrel::HttpServer.new(ops[:host], ops[:port].to_i, ops[:num_processors].to_i, ops[:timeout].to_i)
129:       @listener_name = "#{ops[:host]}:#{ops[:port]}"
130:       @listeners[@listener_name] = @listener
131: 
132:       if ops[:user] and ops[:group]
133:         change_privilege(ops[:user], ops[:group])
134:       end
135: 
136:       # Does the actual cloaking operation to give the new implicit self.
137:       if blk
138:         cloaker(&blk).bind(self).call
139:       end
140: 
141:       # all done processing this listener setup, reset implicit variables
142:       @listener = nil
143:       @listener_name = nil
144:     end