We need to update the client-side interface to indicate that the message cannot be completed. How can I access the Socket.IO JS client immediately after the message failed to execute? For example, something like:
socket.emit("event", data).onError(myCallback);
I know that Socket.IO provides an Ack mechanism to confirm delivery success. Thus, you can set the timer using a handler that causes a failure callback if ack is not called after a certain time. But this is not the best way to do it.
There is also an error event provided by Socket.IO, but there is no information about which error caused the error.
source
share