h5 websocket 会不会导致连接过多服务器会不会压力过大
1个回答
展开全部
var http=require('罩皮http');
var fs=require('fs');
var io=require('socket.io');
var httpObj=http.createServer(function(req,res){
});
httpObj.listen(8080);
var ws=io.listen(httpObj);
//服务器端接收物老差数据
ws.on('含山connection',function(socket){
setInterval(function(){
socket.emit('time',Date.now());
},1000);
socket.on('khd',function(name,content){
console.log(name,content);
});
var fs=require('fs');
var io=require('socket.io');
var httpObj=http.createServer(function(req,res){
});
httpObj.listen(8080);
var ws=io.listen(httpObj);
//服务器端接收物老差数据
ws.on('含山connection',function(socket){
setInterval(function(){
socket.emit('time',Date.now());
},1000);
socket.on('khd',function(name,content){
console.log(name,content);
});
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询