Giter Club home page Giter Club logo

Comments (8)

moohyu avatar moohyu commented on May 18, 2024

chrome is error .. but firefox is ok. You try firefox.

from webrtc-web.

akarshankumar avatar akarshankumar commented on May 18, 2024

Even Firefox has same issue.

from webrtc-web.

nitobuendia avatar nitobuendia commented on May 18, 2024

I was able to reproduce the error and identify where the issue is, but not yet the root cause.

What seems to be happening here is that dataChannel.send(len); is throwing an error because dataChannel is undefined.

This seems to be happening when the channel between the two client has not been established.
This potentially means that line 280 was not executed or ondatachannel was never completed

This can be confirmed because the console does not seem to be showing "CHANNEL opened!!!" as opposed to this scenario where all works normally:
screen shot 2017-11-28 at 22 33 12

Further research needed.

from webrtc-web.

nitobuendia avatar nitobuendia commented on May 18, 2024

The only way I seem to be able to reproduce this consistently is by:

  1. Opening one tab. It creates the room and dataChannel.
  2. Opening a second tab. It joins and connects to the dataChannel.
  3. Refresh original tab.

This seems to be detecting itself as not the initiator, and it tries to make a connection. My understanding is that the other peer never created the channel to which to connect and then, this dataChannel connection is not effective.

Doing this I get almost the same console results than the exposed here.
screen shot 2017-11-28 at 22 47 32

@shamidrasool Could this be how you identified the issue?

As for what might be happening, still more research needed, but I would say that this code:

  peerConn.ondatachannel = function(event) {
    console.log('ondatachannel:', event.channel);
    dataChannel = event.channel;
    onDataChannelCreated(dataChannel);
  };

is not triggered under this circumstance.
dataChannel is defined there as event.channel which would allow to do the dataChannel.send()

The log "'ondatachannel:', event.channel" is not shown on this case, which could confirm it.

from webrtc-web.

transonly avatar transonly commented on May 18, 2024

Is there a solution for this behavior?

from webrtc-web.

nitobuendia avatar nitobuendia commented on May 18, 2024

@transonly Hello Ingrid, sorry for the inconvenience. At the moment, we have still not deep dive here; but I was able to reproduce the issue. I will try to come up with a fix before end of next week.

from webrtc-web.

nitobuendia avatar nitobuendia commented on May 18, 2024

Quick update here:

Currently working on this on nitobuendia:patch-2.

I have been able to detect most cases where connection was closed. However, connection may have been re-opened and that's not fully smooth.

To solve that issue I am trying to detect when a peer leaves and refresh the connection for all remaining peers. It might not be the smoothest way to do it, but it could work. If I get that fully working, we could consider taking a step extra and simply trying a room re-create / re-join without refresh.

Working on it.

from webrtc-web.

nitobuendia avatar nitobuendia commented on May 18, 2024

Quick update here. I am handling mainly two situations:

  • Peer never connected >> on this situation a warning is fired explaining a picture cannot be sent until connection is made. We could as well enable / disable buttons, but this seems a fair fix for this issue for now. Further contributions can make it better.

  • Peer disconnected >> on this situation, we need to manage the re-connection. In general, my first line of work is simply re-create the room. However, I want to manage immediate re-connections to avoid doing this and to avoid an infinite loop of peer join-leave reconnections. That's where I am at right now. I will keep working on it.

from webrtc-web.

Related Issues (20)

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.