hanseuljun / datachannel-unity

libdatachannel for Unity. Supports Windows 10 (x64) and HoloLens 1.
MIT License
12 stars 2 forks source link

DataChannel between 2 different peers #3

Open MarcKami opened 2 years ago

MarcKami commented 2 years ago

Hi,

I've been trying to implement a connection between two different peers and the creation of a datachannel but I've seen something weird things that I'm not sure if it's bacause something is missing or is a normal behaviour. The problem itself is that, when the RTC connection passes to COMPLETED, the datachannel is opened but closed immediatly without errors.

First of all, I've seen that there is no way to know when a datachannel has been created in a peer connection. Seems like onDataChannel is missing in this binding. Is that the case or it is underneath something that I'm not able to see.

Other usefull thing could be the availability to modify some configurations like rtc::Configuration mtu or even the buffer of the datachannel. Now, the only way to modify it is recompiling each time you want to change some value. So could be usefull to do some public properties and export as well the rtc::Configuration.

Kind regard.

hanseuljun commented 2 years ago

Hi Marc,

The behavior does not look ideal...

Sorry that the project is not being actively updated. For missing bindings, I'll have to recommend you for implementation of them by yourself, since I am currently busy meeting my deadlines for graduating school and do not use Unity anymore...

For passing rtc::Configuration, take a look at src/capi_plugin.cpp for bridging libdatachannel to the flavor of C that Unity prefers. unity/DataChannel/Runtime/DataChannelPlugin.cs is where to look at for exposing the Unity-flavored C functions to C#. onDataChannel will be a little bit more challenging since it is a callback, but I am sure it is possible to implement this part too.