Socket.io Duplicate clients on a namespace
- by Servernumber
Hi I'm trying to use dynamic namespace to create them on demand.
It's working except that I get duplicate or more client for some reason
Server side :
io.of("/" + group ).on("connection", function(socket_group) {
socket_group.groupId = group;
socket_group.on("infos", function(){
console.log("on the group !");
})
socket_group.on('list', function () {
Urls.find({'group' : '...'}).sort({ '_id' : -1 }).limit(10).exec(function(err, data){
socket_group.emit('links', data);
});
})
[...]
})
Client Side :
socket.emit('list', { ... });
On the client side only one command is sent but the server is always responding with 2 or more responses. Every time I close/open my app the response is incremented.
Thanks if you find out.