socket.io [RangeError:超出最大调用堆栈大小]

时间:2014-08-07 02:57:23

标签: socket.io

我的代码是:

var arrClients = {};
var client = {
        socket:null,
        username:null,
        uid:false,
        time:null
};
io.sockets.on('connection', function (socket) {

socket.on('message', function (msg) {
    var sendParmas = {};
    if(isFirstTime){
      client.socket = socket;
      client.username = msg;
      client.uid = uuid.v4();
      client.time = getTime();
      arrClients["'" + client.uid + "'"] = client;
      sendParmas.text=arrClients;
      sendParmas.type='firstTime';
      socket.emit('system',sendParmas);
      socket.broadcast.emit('system',sendParmas);
    }
  });
});

client.socket = null;可以运行,如果没有提示:[RangeError:超出最大调用堆栈大小]

0 个答案:

没有答案