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