shinyoshiaki / werift-webrtc

WebRTC Implementation for TypeScript (Node.js), includes ICE/DTLS/SCTP/RTP/SRTP/WEBM/MP4
MIT License
472 stars 31 forks source link

improvement: clean up unused candidates #270

Open koush opened 1 year ago

koush commented 1 year ago

Related to my renegotiation work:

I found that every time the connection is renegotiated on a bundle connection, new ice candidates are generated for that mline. It also seems candidates that are unused/unreachable continue to keep sockets open even after the connection has established.

The result is a hundreds to thousands of lingering open sockets through long sessions with lots of renegotiations (my use case).

I believe fixing the latter, closing/ending unused candidates after the ice transport connects, will fix both bugs.

koush commented 1 year ago

This could also be alleviated significantly by not sending/generating new candidates on established bundle connections. https://github.com/shinyoshiaki/werift-webrtc/issues/269