Giter Club home page Giter Club logo

async-datachannel's People

Contributors

t0b1-ios avatar wngr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

async-datachannel's Issues

Sometimes loses data when sending data at high rates

I noticed that sometimes when I send large amounts of data (e.g. hundreds of megabytes), sometimes messages get lost. Usually it's from the end, but it can be elsewhere.

I have modified the smoke test to reproduce the issue. It is most easy to reproduce it in release mode. The issue appears in one of two ways:

EXPECTED 202, RECEIVED 219 at 78758400

in the stderr of the recipient (the one that has fewer arguments).

Another way is to wait until the end and see that the recipient has not received all the data, while the sender is waiting for acknowledgement from the peer.

I suggest redirecting output to files when running the test. It doesn't also seem very deterministic, so fidgeting with buffer sizes might also impact this..

I don't yet know if the issue is in this library or libdatachannel, but I'll report it here first as I have not written a test case for libdatachannel yet.

edit: updated direct url to smoke.rs

Cannot create multiple DataStreams from one PeerConnection

It seems the interface is designed so that it is impossible to create multiple DataStreams for one PeerConnection. Line 240 of lib.rs says:

    pub async fn dial(self, label: &str) -> anyhow::Result<DataStream> {

taking self in, disallowing it to be called multiple times. In datachannel-rs there is no such limitation, as can be seen from line 355 of peerconnection.rs:

    pub fn create_data_channel_ex<C>(
        &mut self,
        label: &str,
        dc_handler: C,
        dc_init: &DataChannelInit,
    ) -> Result<Box<RtcDataChannel<C>>>

The documentation for libdatachannel doesn't outright say that there can be multiple DataChannels, but it does say that rtcCreateDataChannel adds a datachannel to a Peer Connection and in general this is possible.

It can be useful to have e.g. one unordered and unreliable DataChannel paired with an ordered an reliable DataChannel.

It seems some internal changes are needed to make this happen, peer_con: Arc<Mutex<Box<RtcPeerConnection<ConnInternal>>>> in PeerConnection probably needs to be an Arc as well, for one. I guess I misread it :).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.