コード例 #1
0
 /// <summary>
 /// Raises <b>NewParticipant</b> event.
 /// </summary>
 /// <param name="participant">New participant.</param>
 private void OnNewParticipant(RTP_Participant_Remote participant)
 {
     if (this.NewParticipant != null)
     {
         this.NewParticipant(this, new RTP_ParticipantEventArgs(participant));
     }
 }
コード例 #2
0
        /// <summary>
        /// Gets or creates new participant if participant does not exist.
        /// </summary>
        /// <param name="cname">Participant canonical name.</param>
        /// <returns>Returns specified participant.</returns>
        internal RTP_Participant_Remote GetOrCreateParticipant(string cname)
        {
            if (cname == null)
            {
                throw new ArgumentNullException("cname");
            }
            if (cname == string.Empty)
            {
                throw new ArgumentException("Argument 'cname' value must be specified.");
            }

            lock (m_pParticipants){
                RTP_Participant_Remote participant = null;
                if (!m_pParticipants.TryGetValue(cname, out participant))
                {
                    participant          = new RTP_Participant_Remote(cname);
                    participant.Removed += new EventHandler(delegate(object sender, EventArgs e){
                        m_pParticipants.Remove(participant.CNAME);
                    });
                    m_pParticipants.Add(cname, participant);

                    OnNewParticipant(participant);
                }

                return(participant);
            }
        }
コード例 #3
0
        /// <summary>
        /// Default constructor.
        /// </summary>
        /// <param name="participant">RTP participant.</param>
        /// <exception cref="ArgumentNullException">Is raised when <b>participant</b> is null reference.</exception>
        public RTP_ParticipantEventArgs(RTP_Participant_Remote participant)
        {
            if (participant == null)
            {
                throw new ArgumentNullException("participant");
            }

            m_pParticipant = participant;
        }
コード例 #4
0
        /// <summary>
        /// Sets source owner participant.
        /// </summary>
        /// <param name="participant">RTP participant.</param>
        /// <exception cref="ArgumentNullException">Is raised when <b>participant</b> is null reference.</exception>
        internal void SetParticipant(RTP_Participant_Remote participant)
        {
            if (participant == null)
            {
                throw new ArgumentNullException("participant");
            }

            m_pParticipant = participant;
        }
コード例 #5
0
        /// <summary>
        /// Cleans up any resources being used.
        /// </summary>
        internal override void Dispose()
        {
            m_pParticipant = null;
            if (m_pStream != null)
            {
                m_pStream.Dispose();
            }

            this.ApplicationPacket = null;

            base.Dispose();
        }
コード例 #6
0
        /// <summary>
        /// Cleans up any resources being used.
        /// </summary>
        internal void Dispose()
        {
            if (m_IsDisposed)
            {
                return;
            }
            m_IsDisposed = true;

            m_pSession     = null;
            m_pParticipant = null;

            this.Closed         = null;
            this.Timeout        = null;
            this.SenderReport   = null;
            this.PacketReceived = null;
        }