node.js - 为什么打data事件会触发多次直到服务器响应中的内容读完?
天蓬老师
天蓬老师 2017-04-17 13:39:11
0
1
643

var data = "";
res.on('data', function (chunk) {
data += chunk;
}) .on("end", function () {

});
如果我不写这个事件监听,是不是nodejs内部还是会emit这个data事件多次?不是很理解这个事件的调用过程求科普

天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

reply all(1)
黄舟

Because it needs to set a fixed memory length to receive messages, it does not receive them all at once, but needs to be entered multiple times

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!