paullouisageneau / libdatachannel

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

Enable connectivity checks when using libnice #1262

Closed krystiancha closed 4 days ago

krystiancha commented 1 week ago

When using libnice broken connection is not being detected. After some discussion on Discord Paulo found out that connectivity checks are disabled by default in libnice.

To reproduce the issue:

  1. Complie libdatachannel with libnice instead of libjuice.
  2. Launch a WebRTC-compatible web browser.
  3. Run examples/media-send and using the instructions, get the webcam feed into the browser.
  4. SIGKILL the browser.
  5. media-send will stay in the connected state.
paullouisageneau commented 4 days ago

The exact feature to enable in libnice is ICE consent freshness (which involves keepalive with connectivity checks).