Skip to content

Separate (underlying) datachannels for unreliable and reliable messages #269

@yandeu

Description

@yandeu

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.

// UDP-like channel for realtime data (e.g. binary, serialized game state packets).
const unreliable = RTCPeerConnection.createDataChannel("unreliable", {
    ordered: false,
    maxRetransmits: 0
});

// TCP-like channel for reliable data (e.g. chat message, ad-hoc game state events).
const reliable = RTCPeerConnection.createDataChannel("reliable", {
    ordered: true, // optional?
    maxRetransmits: 10 // Use constant
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions