shinyoshiaki / werift-webrtc

WebRTC Implementation for TypeScript (Node.js), includes ICE/DTLS/SCTP/RTP/SRTP/WEBM/MP4

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

improvement: clean up unused candidates

koush opened this issue · comments

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.

This could also be alleviated significantly by not sending/generating new candidates on established bundle connections. #269