Socket.IO confirmed delivery

Before I dive into the code, can someone tell me if there is any documentation for confirmed delivery to Socket.IO?

Here is what I managed to get:

  • You can call a callback to call when and if the message is acknowledged.
  • There is a special "volatile" mode, which does not guarantee delivery.
  • There is a default mode that is not "mutable"

This leaves me with a few questions:

  • If the message is not mutable, how is it processed? Is it endlessly buffered?
  • Is there a way to get a notification if the message cannot be delivered within a reasonable amount of time?
  • Is there a way to turn off a message if I want to refuse?

I lost a little weight on how Socket.IO can be used in a time-sensitive application, without returning to mutable mode and using an external ACK layer that can provide failure events and some level of configurability. Or am I missing something?

+5
source share
1 answer

TL DR You do not have reliable, confirmed delivery unless you are ready to wait until the universe dies.


The delivery confirmation you are looking for is related to the theoretical problem of two generals , which is also discussed in this SO answer .

TCP manages the reliability issue by ensuring delivery after endless attempts. We live in a finite universe, so the word "guarantee" is theoretically doubtful :-)

, : engine.io, socket.io 1.x :

  • WebSocket
  • FlashSocket
  • XHR
  • JSONP

TCP, TCP . , , , socket.io . " ":

  • engine.io
  • socket.io ,

, , , ? engine.io protocol, socket.io ( 3 4 , ).

, . , socket.io . , , .

:

  • - - ,

:

, TCP "" . socket.io, , .

+4

All Articles