str0m icon indicating copy to clipboard operation
str0m copied to clipboard

Signal when the candidate list changes

Open LeMarwin opened this issue 4 months ago • 2 comments

If I understand correctly, currently there's no way for the outside code to know when a candidate is discarded or re-enabled.

Creating and maintaining an IO resource (e.g. UdpSocket) is costly, especially when one has to create one per candidate pair, and there's no reason to keep it alive if the associated pair was rejected. It would be nice to have additional events like PairAdded, PairRejected to add/remove those when neccessary.

This feature seems to be relatively easy to add. I'll try adding it, but would appreciate any tips and help.

LeMarwin avatar Aug 16 '25 12:08 LeMarwin

My first thought is that it sounds simple enough.

However on second thought, we have what we can think of as a constant trickle ice.

A candidate might not be used initially but given changes in network adding more remote candidates, it might suddenly be chosen.

So the question is what this new event should communicate more than "not in use right now".

algesten avatar Aug 16 '25 18:08 algesten

if the associated pair was rejected

Rejected or not nominated? Those are different things. If you want to reduce the number of IO resources, why are you creating more UDP sockets to begin with?

We just create one that listens on the wildcard address and then use STUN to figure out our address for the candidates. Why would you create more than one UDP socket?

thomaseizinger avatar Aug 16 '25 23:08 thomaseizinger