/// <summary>
            /// Cleans up any resources being used.
            /// </summary>
            public void Dispose()
            {
                lock (m_pLock)
                {
                    if (m_IsDisposed)
                    {
                        return;
                    }
                    m_IsDisposed = true;

                    foreach (SIP_Flow flow in Flows)
                    {
                        flow.Dispose();
                    }

                    m_pOwner = null;
                    m_pFlows = null;
                    m_pTimeoutTimer.Dispose();
                    m_pTimeoutTimer = null;
                }
            }
示例#2
0
        /// <summary>
        /// Default constructor.
        /// </summary>
        public SIP_Stack()
        {
            m_pTransportLayer = new SIP_TransportLayer(this);
            m_pTransactionLayer = new SIP_TransactionLayer(this);
            m_pNonceManager = new Auth_HttpDigest_NonceManager();
            m_pProxyServers = new List<SIP_Uri>();
            m_pRegistrations = new List<SIP_UA_Registration>();
            m_pCredentials = new List<NetworkCredential>();
            m_RegisterCallID = SIP_t_CallID.CreateCallID();

            m_pLogger = new Logger();

            m_pDnsClient = new Dns_Client();
        }
            /// <summary>
            /// Default constructor.
            /// </summary>
            /// <param name="owner">Owner transport layer.</param>
            /// <exception cref="ArgumentNullException">Is raised when <b>owner</b> is null reference.</exception>
            internal SIP_FlowManager(SIP_TransportLayer owner)
            {
                if (owner == null)
                {
                    throw new ArgumentNullException("owner");
                }

                m_pOwner = owner;

                m_pFlows = new Dictionary<string, SIP_Flow>();

                m_pTimeoutTimer = new TimerEx(15000);
                m_pTimeoutTimer.AutoReset = true;
                m_pTimeoutTimer.Elapsed += m_pTimeoutTimer_Elapsed;
                m_pTimeoutTimer.Enabled = true;
            }