Example #1
0
        /// <summary>
        /// Default constructor.
        /// </summary>
        /// <param name="cname">Canonical name of participant. <seealso cref="System.NetworkToolkit.RTP.RTP_Utils.GenerateCNAME"/>RTP_Utils.GenerateCNAME
        /// can be used to create this value.</param>
        /// <exception cref="ArgumentNullException">Is raised when <b>cname</b> is null reference.</exception>
        /// <exception cref="ArgumentException">Is raised when any of the arguments has invalid value.</exception>
        public RTP_MultimediaSession(string cname)
        {
            if (cname == null)
            {
                throw new ArgumentNullException("cname");
            }
            if (cname == string.Empty)
            {
                throw new ArgumentException("Argument 'cname' value must be specified.");
            }

            m_pLocalParticipant = new RTP_Participant_Local(cname);
            m_pSessions         = new List <RTP_Session>();
            m_pParticipants     = new Dictionary <string, RTP_Participant_Remote>();
        }
Example #2
0
        /// <summary>
        /// Cleans up any resources being used.
        /// </summary>
        public void Dispose()
        {
            if (m_IsDisposed)
            {
                return;
            }
            foreach (RTP_Session session in m_pSessions.ToArray())
            {
                session.Dispose();
            }
            m_IsDisposed = true;

            m_pLocalParticipant = null;
            m_pSessions         = null;
            m_pParticipants     = null;

            this.NewParticipant = null;
            this.Error          = null;
        }