How can I determine if a message has reached my server node.js + socket.io. I have an emission from the server to send a message successfully.
socket.on('message', function(msg) {
var sendersusername = msg.source;
if (io.sockets.sockets[socket.id] != undefined)
{
io.sockets.sockets[socket.id].emit('messagesentsuccess',
{"user": msg.target,
"message":msg.message
});
}
});
from this code I get a success message when the message reaches the server. How do I know if a message could be sent to the server?
source
share