var connect = require('connect'),
app = connect();
app.use(connectRoute(function (router) {
router.get('/', function (req, res, next) {
callFun(res);
})
}))
app.listen(port);
/** callFun **/
function callFun(res) {
var http = require('http');
var req = http.request(options, function(response) {
response.on('data', function (chunk) {
res.end(chunk);
});
});
}
当我尝试使用 nodeload 运行上述代码时
./nl.js -c 1 -n 10 -i 1 http://localhost:1000/
我收到以下警告
(node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit.
Trace
at Socket.EventEmitter.addListener (events.js:160:15)
at Socket.Readable.on (_stream_readable.js:663:33)
at ClientRequest.<anonymous> (http.js:2069:7)
at ClientRequest.EventEmitter.emit (events.js:117:20)
at http.js:1710:9
at process._tickCallback (node.js:415:13)
我该如何解决这个问题?
对此的任何帮助都会非常有帮助。谢谢