NewTOAPIA.Net.Rtp.RtpSession._CreateRtpSender C# (CSharp) Method

_CreateRtpSender() private method

Finishes the creation of an RtpSender by adding it to local collections and announcing it to the remote sites via an Rtcp packet
private _CreateRtpSender ( RtpSender rtpSender ) : void
rtpSender RtpSender
return void
        private void _CreateRtpSender(RtpSender rtpSender)
        {
            // Add it to the collection
            lock(rtpSenders)
            {
                rtpSenders.Add(rtpSender.SSRC, rtpSender);
            }

            // We would like to try and have the stream constructed at the remote sites before the 
            // Rtp data starts arriving so that none of it is missed.  To help with that, when an
            // RtpSender is constructed, it sets an Sdes private extension indicating its payload
            // type.  Here we force an Rtcp compound packet to be sent and give it a little time.
            rtcpSender.SendRtcpDataNow();
            Thread.Sleep(250);
        }