Ejemplo n.º 1
0
 public static void CallMetadataShared(this MetashareHooks hooks, FileHash hash, PeerHash peer, int piece)
 {
     hooks.OnMetadataShared?.Invoke(new MetadataShared
     {
         Hash  = hash,
         Peer  = peer,
         Piece = piece
     });
 }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
 public MetashareService Build(MetashareHooks hooks)
 {
     return(new MetashareService(parameters, dependencies, configuration, hooks));
 }
Ejemplo n.º 4
0
 public MetashareService(MetashareParameters parameters, MetashareDependencies dependencies, MetashareConfiguration configuration, MetashareHooks hooks)
 {
     context = new MetashareContext(parameters, dependencies, configuration, hooks);
 }