按照node.js权威指南这本书敲的代码:vardgram=require('dgram');varserver=dgram.createSocket('udp4');server.on('listening',function(){server.setMulticastTTL(128);server.addMembership('230.185.192.108');});setInterval(broadCast,1000);functionbroadCast(){varbuf=newBuffer((newDate()).toLocaleString());server.send(buf,buf.length,8000,'230.185.192.108');}为毛报这样的错啊?我的port是8000,肯定小于65536啊dgram.js:339thrownewRangeError('Portshouldbe>0and
添加回答
举报
0/150
提交
取消