This is fundamentally a specification question as the js client and
node servers behave oppositely. This concerns what is the correct
response when more than one acknowledgement arrives for the same
message id.
Case Node Server to Javascript Client:
--------------------------------------------------------
* Node.js Server .emit()s event "A" (msg type: 5+)
* Javascript Browser Client has registered *2* different
acknowledgements for event "A"
Result: Node.js server will trigger the acknowledgement function
TWICE, once for each acknowledgement message on the same id.
Case Javascript Client to Node Server (exactly the same example from
above inverted):
--------------------------------------------------------
* Javascript Client .emit()s event "A" (msg type: 5+)
* Node.js Server has registered *2* different acknowledgements for
event "A"
Result: Javascript client will trigger the acknowledgement function
only ONCE. The js client reads the first acknowledgement and ignores
all future events on the same message id.
Reading the specification several times, my guess is only one
acknowledgement should be expected when emitting a 5+ event and the
Javascript client is correctly (or legitimately?) ignoring later
acknowledgments. If more than one acknowledgement is received for
the same message id, the behavior might be undefined (which is fine),
but the intent is to have only one acknowledging listener per event.
That said, the opposite is 'workable' if the idea is that perhaps a
bunch of event listeners could be waiting around a large system and
the emitter is expecting to hear acknowledgements from all of them.
Why this is important: I'm nearly done a
socket.io client
implementation in Python for Kivy and I really need to nail down which
is the correct behavior.
Thanks and best regards,
-db-