Exemplo n.º 1
0
 public void Stop()
 {
     lock (_sessionList) {
         foreach (DTLSSession session in _sessionList)
         {
             session.Stop();
         }
         _sessionList.Clear();
     }
     _udpChannel.Stop();
 }
Exemplo n.º 2
0
        /// <summary>
        /// Tell the channel to stop processing data and clean itself up.
        /// </summary>
        public void Stop()
        {
            if (System.Threading.Interlocked.Exchange(ref _running, 0) == 0)
            {
                return;
            }

            lock (_sessionList) {
                foreach (DTLSSession session in _sessionList)
                {
                    session.Stop();
                }
                _sessionList.Clear();
            }
            _udpChannel.Stop();
        }