http在ondata事件以后, 就不会触发onrequest,反之依然
发布于 1年前 作者 yakczh 503 次浏览

JS var server=require('http').createServer(); server.on('request', function(req, res) { console.log(' request '); }); server.on("connection",function (sock) { console.log('connection comming...'); /* sock.ondata=function (data) { console.log('data...'); console.log(data); } */ }); server.on("close",function (sock) { console.log('connection gone away...'); }); server.listen(8080);

回到顶部