- Notifications
You must be signed in to change notification settings - Fork10.1k
Support for unrealiable delivery of WebTransport datagrams#5001
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
Hi, I noticed that socket.io has added support for WebTransport using the polyfill provided by fails-components. I tried to find more information about how socket.io is using WebTransport, but couldn't find much beyond the small amount of information in the changelog when it was added. With the current support for WebTransport is it possible to configure socket.io to only use unreliable delivery with datagrams beneath the hood and tonot fallback to websockets, http long-polling, etc, such that I would then be able to cancel loading the app entirely if the environment/connection cannot support unreliable delivery with WebTransport? Also, if socket.iocan use unreliable delivery through WebTransport, then I assume this would also mean that in such a case socket.io would no longer be guaranteeing the order in which messages are received. Is this correct? |
BetaWas this translation helpful?Give feedback.
All reactions
Hi!
With the current support for WebTransport is it possible to configure socket.io to only use unreliable delivery with datagrams beneath the hood
It is not currently possible to use datagrams, as we rely on a bidirectional stream:https://github.com/socketio/engine.io-client/blob/218c3443f6059de43e916e9add09e9f96d529644/lib/transports/webtransport.ts#L43
Also, if socket.io can use unreliable delivery through WebTransport, then I assume this would also mean that in such a case socket.io would no longer be guaranteeing the order in which messages are received. Is this correct?
True. In that case, the order and the actual transmission of the messages would no longer be guaranteed.
Refe…
Replies: 1 comment 7 replies
-
Hi!
It is not currently possible to use datagrams, as we rely on a bidirectional stream:https://github.com/socketio/engine.io-client/blob/218c3443f6059de43e916e9add09e9f96d529644/lib/transports/webtransport.ts#L43
True. In that case, the order and the actual transmission of the messages would no longer be guaranteed. Reference:https://developer.mozilla.org/en-US/docs/Web/API/WebTransport/datagrams |
BetaWas this translation helpful?Give feedback.
All reactions
👀 1
-
Thanks for confirming. |
BetaWas this translation helpful?Give feedback.
All reactions
👍 1
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
Speaking of reliability.. does WebTransport really have more to offer than WebSocket transport for Socket.io? Is it worth having your transport options set to Polling, Web Socket, THEN upgrade to WebTransport? Seems like a lot of phases to get through to me. Edit: I see WebTransport DOES brag about actually having some reliability, so this is really tempting. Still curious about whether it's worth it to upgrade thru all 3 options though@darrachequesne Thanks! |
BetaWas this translation helpful?Give feedback.
All reactions
-
Hello, I know this is an old thread, but I wanted to revisit this. Guarantees of actual delivery and order are core to the library's design, making it incompatible with a datagram approach. However, with the introduction of WebTransport, specifically its unreliable datagrams, I believe there's a compelling case for reconsideration. The existing io.volatile.emit() functionality in Socket.IO already signals an intent to send data without certain delivery guarantees. It seems like WebTransport's datagrams would be a perfect fit for this particular use case, offering a more native and potentially optimized way to achieve that "fire-and-forget" behavior. I've been seriously considering Socket.IO as a very strong contender for a peer-to-peer data passthrough server, and the ability to leverage unreliable datagrams efficiently is truly the last feature I feel is missing to make it an ideal solution for certain real-time scenarios. Would it make sense to explore how WebTransport datagrams could enhance or integrate with the existing volatile emission strategy? |
BetaWas this translation helpful?Give feedback.
All reactions
🚀 4
-
@darrachequesne bumping this up 👍 |
BetaWas this translation helpful?Give feedback.
All reactions
-
Started a new thread for cleaner converstion |
BetaWas this translation helpful?Give feedback.
All reactions
👍 1