Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can single PeerConnection have multiple DataChannels?

Tags:

webrtc

Can I create multiple datachannels for one PeerConnection ? Can you provide example as to how it can be achieved, else reason why it is not possible?

like image 421
kyunghwanjung Avatar asked Feb 10 '23 13:02

kyunghwanjung


1 Answers

Yes, you can create multiple data channels on a single peer connection:

var pc = new RTCPeerConnection();
var dc = pc.createDataChannel("my channel");
var dc2 = pc.createDataChannel("my other channel");
like image 53
xdumaine Avatar answered Mar 06 '23 12:03

xdumaine