/// <summary>Contructs a torrent using the metainfo filename</summary> /// <param name="metafilename">Filename of the metainfo file</param> internal Torrent(Session session, string metafilename) { this.mSession = session; this.infofile = new MetainfoFile(metafilename); this.downloadFile = new DownloadFile(infofile); this.peerManager = new PeerManager(); this.mDownloadStrategy = new DownloadStrategyManager(this); this.uploadManager = new UploadManager(infofile, downloadFile); this.tp = new TrackerProtocol(this, infofile, downloadFile); // this.downloadManager.PieceFinished += new PieceFinishedCallback(downloadManager_PieceFinished); this.uploadManager.PieceSectionFinished += new PieceSectionFinishedCallback(uploadManager_PieceSectionFinished); this.tp.TrackerUpdate += new TrackerUpdateCallback(tp_TrackerUpdate); }
/// <summary>Contructs a torrent using the metainfo filename</summary> /// <param name="metafilename">Filename of the metainfo file</param> internal Torrent( Session session, string metafilename ) { this.mSession = session; this.infofile = new MetainfoFile(metafilename); this.downloadFile = new DownloadFile(infofile); this.peerManager = new PeerManager(); this.mDownloadStrategy = new DownloadStrategyManager( this ); this.uploadManager = new UploadManager(infofile, downloadFile); this.tp = new TrackerProtocol(this, infofile, downloadFile); // this.downloadManager.PieceFinished += new PieceFinishedCallback(downloadManager_PieceFinished); this.uploadManager.PieceSectionFinished += new PieceSectionFinishedCallback(uploadManager_PieceSectionFinished); this.tp.TrackerUpdate += new TrackerUpdateCallback(tp_TrackerUpdate); }