MonoTorrent.Client.ConnectionManager.CancelPendingConnects C# (CSharp) Method

CancelPendingConnects() private method

private CancelPendingConnects ( TorrentManager manager ) : void
manager TorrentManager
return void
        internal void CancelPendingConnects(TorrentManager manager)
        {
            foreach (AsyncConnectState c in pendingConnects)
                if (c.Manager == manager)
                    c.Connection.Dispose();
        }

Usage Example

コード例 #1
0
        private void LogicTick()
        {
            tickCount++;

            if (tickCount % 2 == 0)
            {
                downloadLimiter.UpdateChunks(Settings.GlobalMaxDownloadSpeed, TotalDownloadSpeed);
                uploadLimiter.UpdateChunks(Settings.GlobalMaxUploadSpeed, TotalUploadSpeed);
            }

            ConnectionManager.CancelPendingConnects();

            ConnectionManager.TryConnect();
            for (int i = 0; i < this.torrents.Count; i++)
            {
                this.torrents[i].Mode.Tick(tickCount);
            }

            RaiseStatsUpdate(new StatsUpdateEventArgs());
        }