SIPSorcery.SIP.SIPTransport.Shutdown C# (CSharp) Method

Shutdown() public method

public Shutdown ( ) : void
return void
        public void Shutdown()
        {
            try
            {
                m_closed = true;

                foreach (SIPChannel channel in m_sipChannels.Values)
                {
                    channel.Close();
                }

                m_inMessageArrived.Set();
                m_inMessageArrived.Set();

                logger.Debug("SIPTransport Shutdown Complete.");
            }
            catch (Exception excp)
            {
                logger.Error("Exception SIPTransport Shutdown. " + excp.Message);
            }
        }

Usage Example

 public void CreateStatefulProxyTest()
 {
     SIPTransactionEngine transactionEngine = new SIPTransactionEngine();
     SIPTransport sipTransport = new SIPTransport(SIPDNSManager.Resolve, transactionEngine, new SIPUDPChannel(new IPEndPoint(IPAddress.Loopback, 3000)), false, false);
     SIPAppServerCore appServerCore = new SIPAppServerCore(sipTransport, null, null, null, null, null);
     sipTransport.Shutdown();
 }
All Usage Examples Of SIPSorcery.SIP.SIPTransport::Shutdown