예제 #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
     });
 }
예제 #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);
        }
예제 #3
0
 public MetashareService Build(MetashareHooks hooks)
 {
     return(new MetashareService(parameters, dependencies, configuration, hooks));
 }
예제 #4
0
 public MetashareService(MetashareParameters parameters, MetashareDependencies dependencies, MetashareConfiguration configuration, MetashareHooks hooks)
 {
     context = new MetashareContext(parameters, dependencies, configuration, hooks);
 }