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

AddSsrcToIp() private method

Verifies that the SSRC matches the IPAddress, if this is a known SSRC, and returns the associated RtpStream. If the SSRC is new, we add the IPAddress to the lookup table.
private AddSsrcToIp ( uint ssrc, IPAddress ipAddress ) : RtpStream
ssrc uint
ipAddress System.Net.IPAddress
return RtpStream
        private RtpStream AddSsrcToIp(uint ssrc, IPAddress ipAddress)
        {
            IPStreamPair ipsp;
            lock(streamsAndIPs)
            {
                if (streamsAndIPs.ContainsKey(ssrc))
                {
                    ipsp = streamsAndIPs[ssrc];
                    if (!ipsp.senderIP.Equals(ipAddress))
                    {
                        HandleSSRCConflict(ssrc, ipAddress);
                    }
                }
                else
                {
                    ipsp = new IPStreamPair(ipAddress, null);
                    streamsAndIPs.Add(ssrc, ipsp);
                }
            }

            return ipsp.stream;
        }