public static void CallMetadataShared(this MetashareHooks hooks, FileHash hash, PeerHash peer, int piece) { hooks.OnMetadataShared?.Invoke(new MetadataShared { Hash = hash, Peer = peer, Piece = piece }); }
public MetashareContext(MetashareParameters parameters, MetashareDependencies dependencies, MetashareConfiguration configuration, MetashareHooks hooks) { this.parameters = parameters; this.dependencies = dependencies; this.configuration = configuration; this.hooks = hooks; collection = new MetashareCollection(); queue = new LeakQueue <MetashareContext>(this); }
public MetashareService Build(MetashareHooks hooks) { return(new MetashareService(parameters, dependencies, configuration, hooks)); }
public MetashareService(MetashareParameters parameters, MetashareDependencies dependencies, MetashareConfiguration configuration, MetashareHooks hooks) { context = new MetashareContext(parameters, dependencies, configuration, hooks); }