paullouisageneau / libdatachannel

C/C++ WebRTC network library featuring Data Channels, Media Transport, and WebSockets
https://libdatachannel.org/
Mozilla Public License 2.0
1.82k stars 365 forks source link

Out of band negotiated DataChannels #233

Closed dbotha closed 4 years ago

dbotha commented 4 years ago

Hi Paul-Louis,

Using webrtc in the browser I am able to pass a negotiated: true flag to the RTCPeerConnection.createDataChannel function which allows me to explicitly create the desired RTCDataChannel's on both sides.

Are such out of band negotiated DataChannels supported by libdatachannel or does the answering side always need to listen for channels created by the offerer like so:

Only Offerer

auto dc = pc->createDataChannel("test");

Only Answerer

shared_ptr<rtc::DataChannel> dc;
pc->onDataChannel([](shared_ptr<rtc::DataChannel> incoming) {});

Kind regards,

Deon

paullouisageneau commented 4 years ago

Hi Deon,

Out-of-band Data Channels are not supported for now but they would be a good enhancement to match the browser API.

dbotha commented 4 years ago

Thanks Paul-Louis!

paullouisageneau commented 4 years ago

Out-of-band negotiated Data Channels are added to the C++ and C API in https://github.com/paullouisageneau/libdatachannel/pull/245