You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by reececomo July 25, 2023
I think Geckos.io would benefit from creating two separate datachannels per connection, one for unreliable and one for reliable.
That would allow certain messages to leverage the existing (super fast) reliable mode at the network layer instead of reimplementing it at the application layer.
// UDP-like channel for realtime data (e.g. binary, serialized game state packets).constunreliable=RTCPeerConnection.createDataChannel("unreliable",{ordered: false,maxRetransmits: 0});// TCP-like channel for reliable data (e.g. chat message, ad-hoc game state events).constreliable=RTCPeerConnection.createDataChannel("reliable",{ordered: true,// optional?maxRetransmits: 10// Use constant});
The text was updated successfully, but these errors were encountered:
Just an update @yandeu, our game has been running a hacked-together version of this for some time and it appears to work great.
Previously on the geckos default implementation of reliable (with default settings) we did see the occasional hitch. Mostly when sending or recv too many reliable packets at once. In fairness we probably could have done some version of Nagle's/batching and sent multiple json blobs in one packet (i.e. what Glenn Fielder suggests).
We were a little worried using a seperate reliable channel might block or interrupt the main (unreliable) channel, but it seems to work great.
No idea if there are any SCTP/DTLS congestion control or scaling issues to be aware of, but after a couple months can highly recommend making the switch.
Discussed in #263
Originally posted by reececomo July 25, 2023
I think Geckos.io would benefit from creating two separate datachannels per connection, one for unreliable and one for reliable.
That would allow certain messages to leverage the existing (super fast) reliable mode at the network layer instead of reimplementing it at the application layer.
The text was updated successfully, but these errors were encountered: