Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Support for unrealiable delivery of WebTransport datagrams#5001

Answeredbydarrachequesne
CoryG89 asked this question inQ&A
Discussion options

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?

You must be logged in to vote

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

Comment options

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.

Reference:https://developer.mozilla.org/en-US/docs/Web/API/WebTransport/datagrams

You must be logged in to vote
7 replies
@CoryG89
Comment options

Thanks for confirming.

@ependergrass
Comment options

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!

@juanjaho
Comment options

That would indeed be incompatible with the guarantees (actual delivery & order) provided by the library, so I don't think this would make sense.

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?

@juanjaho
Comment options

@darrachequesne bumping this up 👍

@juanjaho
Comment options

#5378 (comment)

Started a new thread for cleaner converstion

Answer selected byCoryG89
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Q&A
Labels
None yet
4 participants
@CoryG89@darrachequesne@ependergrass@juanjaho

[8]ページ先頭

©2009-2025 Movatter.jp