Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In the webrtc_adaptor.js one extra redundant DataChannel can be created for one connection. #2004

Closed
canat opened this issue Mar 31, 2020 · 0 comments
Assignees

Comments

@canat
Copy link

canat commented Mar 31, 2020

Describe the bug

In some cases two DataChannels with same label can be created mistakenly for the one webrtc connection. Two DataChannels with the same names can be created first in line 758 and then by the other side onDataChannel method in line 794 of webrtc_adaptor.js.

To Reproduce
1- Enable DataChannel in the server
2- Start publishing with webrtc in WebRTCAppEE/
3- Start playing same stream in WebRTCAppEE/play.html
4- Send text messages from dataChannels in developer console using statements like webRTCAdaptor.sendData("stream1", "Hi 2") from WebRTCAppEE/ and WebRTCAppEE/play.html
5- Stop publishing in WebRTCAppEE/
6- You will see in the console printouts that DataChannels are closed two times.

Expected behavior
Only one DataChannel should exist for the connection.
Solution in the Android side:
Only publisher or initiator in peer mode should createDataChannel in the initialization.
In the play mode DataChannel should be not created in the initialization. It should be received by the player in the onDataChannel method.
In peer mode DataChannel should be created only by the side who created the offer. The other side should receive DataChannel in the onDataChannel method.

For more information check in-band negotiation in this stackoverflow entry: https://stackoverflow.com/questions/43788872/how-are-data-channels-negotiated-between-two-peers-with-webrtc

@mekya mekya self-assigned this Apr 20, 2020
@mekya mekya closed this as completed May 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants