private void CheckForStaleParticipants()
{
lock(participants)
{
// Participants are stored in a hashtable, you can't remove an item in a foreach loop
// So make a copy of the participants to iterate on, but delete from the hashtable
foreach(RtpParticipant participant in new ArrayList(participants.Values))
{
if(participant.SSRCs.Count == 0)
{
if(participant.Stale++ >= RtcpMissedIntervalsTimeout)
{
RaiseParticipantTimeoutEvent(participant);
RemoveParticipant(participant);
}
}
}
}
}