node.js - Sending sockets to client side, Error: Converting circular structure to JSON -


i'm working in node js , i'm trying send array, clients, server every client normal emit, keeps giving me error:

data = json.stringify(ev);

typeerror: converting circular structure json

shortly, do.

var clients = new array(); io.sockets.on('connection', function(socket) {    clients.push(socket);     socket.on('loginuser', function(data){    io.sockets.emit("getusers", clients); }); 

i've seen couple of other people having problem, answers didn't work out me.

looking @ bigger problem, can't send array of sockets client side. sockets objects make sense in current context/process. if want control sockets client side, instead add sort of rpc functionality.


Comments

Popular posts from this blog

c++ - How to add Crypto++ library to Qt project -

jQuery Mobile app not scrolling in Firefox -

How to use vim as editor in Matlab GUI -