socket.io-poco
socket.io-poco copied to clipboard
socket.send not interpreted as a "message" event socket.emit
On my server side I send a message to the client:
socket.emit('message',JSON.stringify(send_msg));
but then if I do
socket.send(JSON.stringify(send_msg));
The message is not properly caught and the handleMessage is fired instead of the handleEvent. I have read here: http://stackoverflow.com/questions/11498508/socket-emit-vs-socket-send that send is a "simplified" version of an emit (no custom event, just "message").
I can see in the logger that the message is received but not correctly interpreted.