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

InitializeNetwork() private method

Initialize the Rtcp/Rtp listeners and senders. See the primary constructor's summary for an explanation of the "states" an RtpSession can be constructed in.
private InitializeNetwork ( ) : void
return void
        private void InitializeNetwork()
        {
            if( receiveData )
            {
                if(participant != null && rtpTraffic)
                {
                    rtpListener = new RtpListener(this);   
                }

                // RtcpListener can create streams.  A stream needs a valid RtpListener in order to
                // return used packets, so start this object/thread after RtpListener.
                rtcpListener = new RtcpListener(this);
            }

            if(participant != null)
            {
                // Set the participant's IP address
                //participant.IPAddress = Utility.GetLocalMulticastInterface();
                participant.IPAddress = Utility.GetLocalRoutingInterface(multicastEP.Address, (ushort)multicastEP.Port);

                // Get an ssrc for the local participant
                uint ssrc = NextSSRC();
                AddParticipant(ssrc, participant);
                AddSsrcToIp(ssrc, participant.IPAddress);
                
                rtcpSender = new RtcpSender(this);    
            }
        }