public static void CallMetafileRejected(this MetafileHooks hooks, FileHash hash) { hooks.OnMetafileRejected?.Invoke(new MetafileRejected { Hash = hash }); }
public MetafileContext(MetafileParameters parameters, MetafileDependencies dependencies, MetafileHooks hooks) { this.parameters = parameters; this.dependencies = dependencies; this.hooks = hooks; queue = new LeakQueue <MetafileContext>(this); destination = new MetafileDestination(this); }
public static void CallMetafileVerified(this MetafileHooks hooks, FileHash hash, Metainfo metainfo, int size) { hooks.OnMetafileVerified?.Invoke(new MetafileVerified { Hash = hash, Metainfo = metainfo, Size = size }); }
public static void CallMetafileWritten(this MetafileHooks hooks, FileHash hash, int piece, int size) { hooks.OnMetafileWritten?.Invoke(new MetafileWritten { Hash = hash, Piece = piece, Size = size }); }
public static void CallMetafileRead(this MetafileHooks hooks, FileHash hash, int piece, int total, byte[] data) { hooks.OnMetafileRead?.Invoke(new MetafileRead { Hash = hash, Piece = piece, Total = total, Payload = data }); }
public MetafileService Build(MetafileHooks hooks) { return(new MetafileImplementation(parameters, dependencies, hooks)); }
public MetafileImplementation(MetafileParameters parameters, MetafileDependencies dependencies, MetafileHooks hooks) { context = new MetafileContext(parameters, dependencies, hooks); }