Beispiel #1
0
        private void DhtEngineStateChanged(object o, EventArgs e)
        {
            if (dhtEngine.State != DhtState.Ready)
            {
                return;
            }

            MainLoop.Queue(() =>
            {
                foreach (var manager in torrents.Where(manager => manager.CanUseDht))
                {
                    dhtEngine.Announce(manager.InfoHash, Listener.Endpoint.Port);
                    dhtEngine.GetPeers(manager.InfoHash);
                }
            });
        }
Beispiel #2
0
        void DhtEngineStateChanged(object o, EventArgs e)
        {
            if (dhtEngine.State != DhtState.Ready)
            {
                return;
            }

            MainLoop.Queue(delegate {
                foreach (TorrentManager manager in torrents)
                {
                    if (!manager.CanUseDht)
                    {
                        continue;
                    }

                    dhtEngine.Announce(manager.InfoHash, Listener.Endpoint.Port);
                    dhtEngine.GetPeers(manager.InfoHash);
                }
            });
        }