SIPSorcery.SIP.SIPTLSChannel.Close C# (CSharp) Method

Close() public method

public Close ( ) : void
return void
        public override void Close()
        {
            if (!Closed == true)
            {
                logger.Debug("Closing SIP TLS Channel " + SIPChannelEndPoint + ".");

                Closed = true;

                try
                {
                    m_tlsServerListener.Stop();
                }
                catch (Exception listenerCloseExcp)
                {
                    logger.Warn("Exception SIPTLSChannel Close (shutting down listener). " + listenerCloseExcp.Message);
                }

                lock (m_connectedSockets)
                {
                    foreach (SIPConnection tcpConnection in m_connectedSockets.Values)
                    {
                        try
                        {
                            tcpConnection.SIPStream.Close();
                        }
                        catch (Exception connectionCloseExcp)
                        {
                            logger.Warn("Exception SIPTLSChannel Close (shutting down connection to " + tcpConnection.RemoteEndPoint + "). " + connectionCloseExcp.Message);
                        }
                    }
                }
            }
        }