How can I....
The answer so all of these questions is that by varying the logic which handles the events from source to client as well as using information from the RTCP flows and any additional information which can be gathered through RTSP or HTTP such as
Delay and Last Message Round Trip Time.
You will always be able to determine the number of available clients and furthermore the number of clients connected to a particular source.
*Todo provide examples as requested*
Currently by default the algorithm utilized by the RtspServer for Rtp and Rtcp flows is no different from that found in
RFC3550; which is essence is to the receive sequence numbers of the packets from a source, I further allow the same algorithm to be applied during sending; this allows packets which
occur out of order to optionally be processed when they arrive and potentially sent to a client who has not yet already experienced this loss (or to allow the late transmission or re-transmission of the packet to a client if desired).
The algorithm can also be varied with respect to the overall state of the server, number of clients, bit rate or otherwise but this is usually not required unless there is severe network interference.
The algorithm can be totally eliminated and you can send everything which is received (including duplicates to the sources or even invalid packets if you so choose or require.)