Here is what I have:
Client Side:
socket.on('PING__',function (data){
console.log(data);
});
socket.emit('__PING');
Server Side:
io.sockets.on('connection', function (socket) {
var connection = socket;
socket.on('__PING', function (data) {
console.log(data);
socket.emit('PING__' , {status:'OK'});
});
});
The console logs out "object {status:'OK'}". If I do this instead on the client:
console.log(data.status);
I get undefined. I don't understand why it isn't logging out the status portion of the JSO. Any help here would be great