Inheritance: OctoTorrent.Client.Mode
Esempio n. 1
0
        /// <summary>
        /// Stops the TorrentManager
        /// </summary>
        public void Stop()
        {
            if (State == TorrentState.Error)
            {
                _error = null;
                Mode   = new StoppedMode(this);
                return;
            }

            if (Mode is StoppingMode)
            {
                return;
            }

            ClientEngine.MainLoop.QueueWait(delegate {
                if (State != TorrentState.Stopped)
                {
#if !DISABLE_DHT
                    _engine.DhtEngine.PeersFound -= DhtPeersFound;
#endif
                    Mode = new StoppingMode(this);
                }
            });
        }