Giter Club home page Giter Club logo

Comments (4)

karasusan avatar karasusan commented on August 12, 2024

Could you attach the full code that can reproduce the problem?

from com.unity.webrtc.

tobias-stein avatar tobias-stein commented on August 12, 2024

Hi,

this is pretty much all I am doing
`
public bool AddDataChannel(string InDataChannelLabel, DataChannelReady OnReady, DataChannelClosed OnClosed, DataChannelReceived OnRecv)
{
// do not open a data channel twice for the same label
if (this.DataChannels.ContainsKey(InDataChannelLabel))
return false;

        RTCDataChannelInit Options = default;
        var DC = this.PC.CreateDataChannel(InDataChannelLabel, ref Options);
        if (DC == null)
            return false;

        // store data channel handle
        this.DataChannels.Add(InDataChannelLabel, DC);

        // hook-up events
        DC.OnOpen += () => { if (OnReady != null) { OnReady.Invoke(); } };
        DC.OnClose += () => 
        {
            if (OnClosed != null) { OnClosed.Invoke(); }
            DC.OnMessage = null;
        };
        DC.OnMessage += (bytes) => { if (OnRecv != null) { OnRecv.Invoke(bytes); } };

        return true;
    }

`

I called the WebRTC.Init method before. PC is an initialized PeerConnection object.

Cheers,
Tobi

from com.unity.webrtc.

tobias-stein avatar tobias-stein commented on August 12, 2024

Hi,
another way to reproduce the crash: simply put the following

RTCDataChannelInit opt = default;
var DC = pc.CreateDataChannel("foo", ref opt);

In the "void OnOffer(ISignaling signaling, DescData e)" method of the RenderStreaming MonoBehaviour.

Cheers,
Tobi.

from com.unity.webrtc.

karasusan avatar karasusan commented on August 12, 2024

Fixed this issue and will release the bug-fix version this week. Thanks!

from com.unity.webrtc.

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.