Examples of AZInstance


Examples of com.aelitis.azureus.core.instancemanager.AZInstance

     
        AZInstance[] instances = instance_manager.getOtherInstances();
       
        for (int i=0;i<instances.length;i++){
         
          AZInstance instance = instances[i];
         
          List addresses = instance.getInternalAddresses();
         
          if ( addresses.contains( ad )){
           
            for ( int j=0; j<addresses.size();j++){
             
View Full Code Here

Examples of com.aelitis.azureus.core.instancemanager.AZInstance

  runInitialChecks(
      AzureusCore azureus_core)
  {
    AZInstanceManager i_man = azureus_core.getInstanceManager();
   
    final AZInstance  my_instance = i_man.getMyInstance();
   
    i_man.addListener(
      new AZInstanceManagerListener()
      {
        private InetAddress external_address;
View Full Code Here

Examples of com.aelitis.azureus.core.instancemanager.AZInstance

   
    while( it.hasNext()){
     
      Map.Entry  entry = (Map.Entry)it.next();
     
      AZInstance  inst   = (AZInstance)entry.getKey();
      Map      reply  = (Map)entry.getValue();
 
      boolean  seed = ((Long)reply.get( "seed" )).intValue() == 1;
 
      res[ pos++ ] = new trackedInstance( inst, target, seed );
View Full Code Here

Examples of com.aelitis.azureus.core.instancemanager.AZInstance

 
  protected int
  handleTrackResult(
    AZInstanceTracked    tracked_inst )
  {
    AZInstance  inst  = tracked_inst.getInstance();
   
    Download  download = (Download)tracked_inst.getTarget().getTarget();
       
    boolean  is_seed = tracked_inst.isSeed();
   
    long  now    = plugin_interface.getUtilities().getCurrentSystemTime();
   
    boolean  skip   = false;
   
      // this code is here to deal with multiple interface machines that receive the result multiple times
   
    try{
      mon.enter();
     
      Map<String,Long>  map = track_times.get( inst.getID() );
     
      if ( map == null ){
       
        map  = new HashMap<String, Long>();
       
        track_times.put( inst.getID(), map );
      }
     
      String  dl_key = plugin_interface.getUtilities().getFormatters().encodeBytesToString(download.getTorrent().getHash());
     
      Long  last_track = map.get( dl_key );
     
      if ( last_track != null ){
       
        long  lt = last_track.longValue();
       
        if ( now - lt < 30*1000 ){
         
          skip  = true;
        }
      }
     
      map.put( dl_key, new Long(now));
     
    }finally{
     
      mon.exit();
    }
   
    if ( skip ){
   
      return( -1 );
    }
   
    log.log( "Tracked: " + inst.getString() + ": " + download.getName() + ", seed = " + is_seed );

    if ( download.isComplete() && is_seed ){
     
      return( is_seed?1:0 );
    }
   
    PeerManager  peer_manager = download.getPeerManager();
   
    if ( peer_manager != null ){ 
     
      String  peer_ip      = inst.getInternalAddress().getHostAddress();
      int    peer_tcp_port  = inst.getTCPListenPort();
      int    peer_udp_port  = inst.getUDPListenPort();
     
      log.log( "    " + download.getName() + ": Injecting peer " + peer_ip + ":" + peer_tcp_port + "/" + peer_udp_port);
     
      peer_manager.addPeer( peer_ip, peer_tcp_port, peer_udp_port, false );
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.