Пример #1
0
        internal TorrentDownload Add(Metainfo metainfo, ITracker tracker, IFileHandler fileHandler)
        {
            var dataHandler = new PieceCheckerHandler(new BlockDataHandler(fileHandler, metainfo));
            var bitTorrentApplicationProtocol = new BitTorrentApplicationProtocol <BitTorrentPeerInitiator.IContext>(LocalPeerId, metainfo, peerInitiator, m => new QueueingMessageHandler(mainLoop, m), moduleManager, dataHandler);
            var downloadManager = new TorrentDownloadManager(LocalPeerId,
                                                             mainLoop,
                                                             bitTorrentApplicationProtocol,
                                                             tracker,
                                                             metainfo);

            var download = new TorrentDownload(downloadManager);

            downloads.Add(metainfo.InfoHash, download);
            return(download);
        }
Пример #2
0
 internal TorrentDownload(TorrentDownloadManager download)
 {
     this.download = download;
 }