I'm using NodeJs v0.10.28 and everytime i try to login to the chat i get a error
TypeError: Object #<Socket> has no method 'set' at Socket.<anonymous>
And if i'm deleting the lines it works but not working right.
What is the wrong thing in this code
// get the name of the sender
socket.get('nickname', function (err, name) {
console.log('Chat message by ', name);
console.log('error ', err);
sender = name;
});
AND
socket.set('nickname', name, function () {
// this kind of emit will send to all! :D
io.sockets.emit('chat', {
msg : "Welcome, " + name + '!',
msgr : "Nickname"
});
});
FULL CODE