-
Notifications
You must be signed in to change notification settings - Fork 454
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Socket.io in-order message delivery warning still valid? #375
Comments
I was wondering about this myself. +1 for an authoritative answer... |
When using the websocket transport, messages are guaranteed to be in order (thanks to TCP), but other transports supported by socket.io do not guarantee this (e.g. polling), since they may open multiple connections simultaneously (thus creating race conditions). We ran into this issue when using ShareJS with socket.io at Storify and ended up wrapping the sharejs protocol in our own protocol that guarantees in-order delivery. You basically have to assign a sequence number to each message that increments whenever a message is sent (on both the client and server ends, separately). Both ends then buffer messages that are received out of order until the missing messages come in. Here is an implementation in browserchannel that you can adapt for your own purposes. |
@devongovett Thank you for your explanation and the solution! I didn't know that socket.io hasn't implemented in order delivery for their fallback transport mechanisms. Too bad... However, I think with your proposed solution it will also work for my purposes. Therefore thanks again 👍 |
and now I wonder how hard it would be to add an in-order option to On Wed, May 20, 2015 at 10:01 AM Tobias notifications@github.com wrote:
|
Thanks for the advice, I'll see what I come up with 👍 |
Linking issue josephg#375 from README for users interested in Socket.IO.
Hi,
I'm planning to implement a real-time collaboration platform using ShareJS. Since the documentation seems to be a bit outdated, I'm not quite sure whether the warning "Danger danger socket.io does not guarantee [in-order message delivery]" is still valid.
With version 1.x socket.io introduced major changes and therefore I'm asking myself if it might have changed its message delivery properties. However, I was not able to find any information about this.
Is there any new information regarding the compatibility of ShareJS and socket.io?
Thanks!
The text was updated successfully, but these errors were encountered: