private void StartMetaStore(string destination) { MetafileHooks hooks = new MetafileHooks { OnMetafileVerified = OnMetafileVerified, OnMetafileRead = data => MetaShare?.Handle(data) }; MetaStore = new MetafileBuilder() .WithHash(Hash) .WithPipeline(Pipeline) .WithFiles(Files) .WithDestination(Path.Combine(destination, $"{Hash}.metainfo")) .Build(hooks); MetaStore.Start(); }
private void OnMetadataRequestReceived(MetadataRequested data) { Notifications.Enqueue(new MetafileRequestedNotification(data.Hash, new PieceInfo(data.Piece))); MetaShare?.Handle(data); }