webrtc icon indicating copy to clipboard operation
webrtc copied to clipboard

Making an unordered unreliable datachannel doesn't seem possible

Open echeese opened this issue 2 years ago • 7 comments

Creating a datachannel with ordered = false and (max_retransmits = 0 or max_packet_lifetime = 0) seems to fall back to making a reliable channel.

The receiving other client has maxPacketLifeTime: null and maxRetransmits: null

echeese avatar Dec 16 '22 23:12 echeese

Hey @echeese, could you provide a minimal reproducible example of this? I probably won't have time to work on it but if it is indeed a bug having such an example would be good

k0nserv avatar Jan 04 '23 11:01 k0nserv

@echeese Looking at https://github.com/webrtc-rs/webrtc/pull/186 and https://github.com/webrtc-rs/data/pull/5 I think you are just correct. No need to create a minimal repro.

Someone who's interested in this could ressurect the PRs from @connorcarpenter

k0nserv avatar Jan 09 '23 16:01 k0nserv

Sorry for the lack of response, I was on vacation, but yes those PRs seem to match my findings

echeese avatar Jan 09 '23 16:01 echeese

No problem, if you wanna work on this it'd be great. I wouldn't expect it to get fixed unless someone with a desire for the use-case contributes a fix

k0nserv avatar Jan 09 '23 16:01 k0nserv

I have something: https://github.com/zduny/webrtc/commit/8a9138cfd1ddf5c1b32a9579f0033cb4768fa4d5

References: https://github.com/pion/webrtc/blob/master/datachannel.go https://stackoverflow.com/questions/54292824/webrtc-channel-reliability

But it would be nice to add a test checking if unreliable channel is created. @echeese - what was your method of checking if created channel is unreliable?

zduny avatar Jan 17 '23 18:01 zduny

What's the status on this? It seems like that PR was closed after submodule changes and was never actually merged. If needed, I can remake them, since it seems like nobody else actually cares about this use-case... strange considering the various rust game engines basing their netcode on this library without actually ... trying it.

CouleeApps avatar Oct 29 '23 16:10 CouleeApps

I do care; I don't care about reliability as I will be doing TCP inside WebRTC for my use case if I really need it. I have also created a set of patches (in my profile) which tries to disable all forms of reliability for the packets and all forms of congestion control and stats collection, if you're interested. It has made it lighter, too.

Also a surprising observation: Tokio Mutexes and Semaphores are surprisingly too slow, so I switched some things to native threads, it made it work like 100x faster. Last time a performance bottleneck was fixed by just removing tokio semaphores and it made things magically 3x faster.

ris-work avatar Feb 28 '24 17:02 ris-work