Example #1
0
        private void MetaDataThreadProc()
        {
            while (exitThreads == false)
            {
                if (State != BtmState.Running)
                {
                    continue;
                }


                TorrentHandles handles = new TorrentHandles();
                GetAllTorrentHandles(ref handles);


                for (Int32 i = 0; i < handles.mNumHandles; i++)
                {
                    Int32 handle = handles.mHandles[i];

                    Torrent torrent = GetTorrent((UInt32)handle);
                    if (torrent != null)
                    {
                        torrent.RefreshMetaData();

                        if (TorrentMataDataUpdated != null)
                        {
                            TorrentMataDataUpdated(this, new TorrentActionEventArgs((UInt32)handle));
                        }
                    }
                }


                /* TODO : One MINUTE NOT one second
                 * foreach (Torrent torrent in torrentList)
                 * {
                 *  torrent.SubmitGraphData((TimeTorrentManagerRunning() / (60000)), (torrent.MetaData.DownloadSpeed / 1024), (TimeTorrentManagerRunning() / 60000), (torrent.MetaData.UploadSpeed / 1024));
                 * }
                 *
                 *
                 * float dlSpeed = ((float)TotalDownloadRate() / 1024.0f);
                 * float ulSpeed = ((float)TotalUploadRate() / 1024.0f);
                 *
                 * //downloadGraphData.Add(TimeTorrentManagerRunning() / 60000, dlSpeed);
                 * //uploadGraphData.Add(TimeTorrentManagerRunning() / 60000, ulSpeed);
                 *
                 * //if (MainForm.mBandwidthGraph != null)
                 * //{
                 * //    MainForm.mBandwidthGraph.UpdateCurves();
                 * //}
                 */

                Thread.Sleep(1000);
            }
        }
Example #2
0
 public static extern void GetAllTorrentHandles(ref TorrentHandles handles);
Example #3
0
 private static extern void GetAllTorrentHandles(ref TorrentHandles handles);