socket.io icon indicating copy to clipboard operation
socket.io copied to clipboard

quality of service features

Open fkromer opened this issue 5 years ago • 2 comments

You want to:

  • [ ] report a bug
  • [x] request a feature

Current behaviour

It seems like socket.io does not support quality of service features yet like e.g. MQTT does like e.g. explained here. I'm not sure if it's possible to build some or all QoS features into socket.io. Or if it's possible at all because I don't know the socket.io architecture. However would be nice to have QoS features or at least some section in the docs about socket.io message transmission reliability.

Steps to reproduce (if the current behaviour is a bug)

NA

Expected behaviour

NA

Setup

NA

Other information (e.g. stacktraces, related issues, suggestions how to fix)

NA

fkromer avatar Sep 24 '20 11:09 fkromer

That would be interesting indeed. Currently the message transmission is a best effort process (which should translate to At most once in MQTT terminology). If the client looses connection to the server, the packets are buffered until it reconnects, but there's no acknowledgement or such.

I'm not sure how it could be implemented. Maybe some kind of extension above? Or directly in the protocol?

You may find additional information here: https://github.com/socketio/socket.io-protocol

darrachequesne avatar Oct 05 '20 09:10 darrachequesne

@darrachequesne Thanks for letting me know. I just needed the info. No rush. I don't need the feature ATM.

fkromer avatar Oct 05 '20 11:10 fkromer

For future readers:

At least once semantics was implemented in version 4.6.0:

  • with Connection state recovery on the server side: https://socket.io/docs/v4/connection-state-recovery
  • with (potentially infinite) retries on the client side: https://socket.io/docs/v4/client-options/#retries

Exactly once semantics can be achieved by attaching an unique ID to each packet on the client side, and storing them in the same transaction when handling the packet on the server side.

Please reopen if needed!

darrachequesne avatar Feb 16 '23 07:02 darrachequesne