LearnBoost's Socket.IO-Node why onClientMessage not work

Posted by KingPin on Stack Overflow See other posts from Stack Overflow or by KingPin
Published on 2010-06-06T14:13:52Z Indexed on 2010/06/06 14:22 UTC
Read the original article Hit count: 249

Hi, all,

I tried to put the module "LearnBoost's Socket.IO-Node", all works, except event 'onClientMessage'

Tell, in what there can be a problem, thanks!

...sorry for my english

io.listen(server, {

onClientConnect: function(client){
    client.send(json({ buffer: buffer }));
    client.broadcast(json({ announcement: client.sessionId + ' connected' }));
},

onClientDisconnect: function(client){
    client.broadcast(json({ announcement: client.sessionId + ' disconnected' }));
},

onClientMessage: function(message, client){
    var msg = { mess: [client.sessionId, message] };
    buffer.push(msg);
    if (buffer.length > 15) {
        buffer.shift();
    }
    client.broadcast(json(msg));

}

© Stack Overflow or respective owner

Related posts about javascript-events

Related posts about node.js