Package org.gudy.azureus2.core3.tracker.client

Examples of org.gudy.azureus2.core3.tracker.client.TRTrackerAnnouncerResponsePeer


    out.println("Torrent Filename: " + dm.getTorrentFileName());
    out.println("Saving to: " + dm.getSaveLocation());
    out.println("Created By: " + dm.getTorrentCreatedBy());
    out.println("Comment: " + dm.getTorrentComment());
    out.println("- Tracker Info -");
    TRTrackerAnnouncer trackerclient = dm.getTrackerClient();
    if (trackerclient != null) {
      out.println("URL: " + trackerclient.getTrackerURL());
      String timestr;
      try {
        int time = trackerclient.getTimeUntilNextUpdate();
        if (time < 0) {
          timestr = MessageText.getString("GeneralView.label.updatein.querying");
        } else {
          int minutes = time / 60;
          int seconds = time % 60;
          String strSeconds = "" + seconds;
          if (seconds < 10) {
            strSeconds = "0" + seconds; //$NON-NLS-1$
          }
          timestr = minutes + ":" + strSeconds;
        }
      } catch (Exception e) {
        timestr = "unknown";
      }
      out.println("Time till next Update: " + timestr);
      out.println("Status: " + trackerclient.getStatusString());
    } else
      out.println("  Not available");
   
    out.println("- Files Info -");
    DiskManagerFileInfo files[] = dm.getDiskManagerFileInfo();
View Full Code Here


  addPeersFromTracker(
    TRTrackerAnnouncerResponsePeer[]    peers )
  {

    for (int i = 0; i < peers.length; i++){
      final TRTrackerAnnouncerResponsePeer  peer = peers[i];

      final ArrayList peer_transports = peer_transports_cow;

      boolean already_connected = false;

      for( int x=0; x < peer_transports.size(); x++ ) {
        final PEPeerTransport transport = (PEPeerTransport)peer_transports.get( x );

        // allow loopback connects for co-located proxy-based connections and testing

        if( peer.getAddress().equals( transport.getIp() )){

          final boolean same_allowed = COConfigurationManager.getBooleanParameter( "Allow Same IP Peers" ) ||
         
          transport.getIp().equals( "127.0.0.1" );

          if( !same_allowed || peer.getPort() == transport.getPort() ) {
            already_connected = true;
            break;
          }
        }
      }

      if( already_connected continue;

      if( peer_database != null ){
       
        byte type = peer.getProtocol() == DownloadAnnounceResultPeer.PROTOCOL_CRYPT ? PeerItemFactory.HANDSHAKE_TYPE_CRYPTO : PeerItemFactory.HANDSHAKE_TYPE_PLAIN;

        byte crypto_level = peer.getAZVersion() < TRTrackerAnnouncer.AZ_TRACKER_VERSION_3?PeerItemFactory.CRYPTO_LEVEL_1:PeerItemFactory.CRYPTO_LEVEL_2;

        PeerItem item = PeerItemFactory.createPeerItem(
            peer.getAddress(),
            peer.getPort(),
            PeerItem.convertSourceID( peer.getSource() ),
            type,
            peer.getUDPPort(),
            crypto_level,
            peer.getUploadSpeed());

        peerDiscovered( null, item );
       
        peer_database.addDiscoveredPeer( item );
      }

      int  http_port = peer.getHTTPPort();

      if ( http_port != 0 && !seeding_mode ){

        adapter.addHTTPSeed( peer.getAddress(), http_port );
      }
    }
  }
View Full Code Here

     
      Iterator it = tracker_peer_cache.values().iterator();
     
      while( it.hasNext()){
       
        TRTrackerAnnouncerResponsePeer  peer = (TRTrackerAnnouncerResponsePeer)it.next();   
 
        LightHashMap entry = new LightHashMap();
       
        entry.put( "ip", peer.getAddress().getBytes());
        entry.put( "src", peer.getSource().getBytes());
        entry.put( "port", new Long(peer.getPort()));
       
        int  udp_port = peer.getUDPPort();
        if ( udp_port != 0 ){
          entry.put( "udpport", new Long( udp_port));
        }
        int  http_port = peer.getHTTPPort();
        if ( http_port != 0 ){
          entry.put( "httpport", new Long( http_port));
        }
       
        entry.put( "prot", new Long(peer.getProtocol()));
       
        byte  az_ver = peer.getAZVersion();
       
        if ( az_ver != TRTrackerAnnouncer.AZ_TRACKER_VERSION_1 ){
          entry.put( "azver", new Long( az_ver ));
        }
       
View Full Code Here

          return "";
        return "(max " + DisplayFormatters.formatByteCountToKiBEtcPerSec(uploadSpeed) + ")";
       
      case 'S':
      case 'P':
        TRTrackerScraperResponse hd = dm.getTrackerScrapeResponse();
        if (hd == null || !hd.isValid())
          return "?";
        else
        {
          if( variable == 'S' )
            return Integer.toString(hd.getSeeds());
          else
            return Integer.toString(hd.getPeers());
        }
      default:
        return "??" + variable + "??";
    }
  }
View Full Code Here

  protected boolean performCommand(ConsoleInput ci, DownloadManager dm, List args) {
    TOTorrent torrent = dm.getTorrent();
        if (torrent != null) {
          try {
          TRHost  host = ci.azureus_core.getTrackerHost();
         
          TRHostTorrent  existing = host.getHostTorrent( torrent );
         
          if ( existing == null ){
           
            host.publishTorrent(torrent);
          }else{
            try{
              existing.remove();
             
            }catch( Throwable e ){
View Full Code Here

    TOTorrent torrent = dm.getTorrent();
        if (torrent != null) {
          try {
          TRHost  host = ci.azureus_core.getTrackerHost();
         
          TRHostTorrent  existing = host.getHostTorrent( torrent );
         
          if ( existing == null ){
           
            host.publishTorrent(torrent);
          }else{
            try{
              existing.remove();
             
            }catch( Throwable e ){
             
              e.printStackTrace();
            }
View Full Code Here

    }
   
    final trustDialog[]  dialog = new trustDialog[1];
   
    try{
      Utils.execSWTThread(new AERunnable() {
            public void
            runSupport()
            {
              dialog[0] = new trustDialog( display, resource, cert );
            }
View Full Code Here

      return;
    }
   
    try{
      display.asyncExec(
          new AERunnable()
          {
            public void
            runSupport()
            {
               new createDialog( display );
View Full Code Here

    if (logAlert.details != null) {
      text += "\n<A HREF=\"details\">" + MessageText.getString("v3.MainWindow.button.viewdetails") + "</A>";
    }

    Utils.execSWTThread(new AERunnable() {
      public void runSupport() {
        openWindow();
      }
    });
  }
View Full Code Here

  /* (non-Javadoc)
   * @see org.eclipse.ui.IStartup#earlyStartup()
   */
  public void earlyStartup() {
    final Display display = Display.getDefault();
    display.syncExec(new AERunnable() {
      public void runSupport() {
        hookApplicationMenu(display);
      }
    });
  }
View Full Code Here

TOP

Related Classes of org.gudy.azureus2.core3.tracker.client.TRTrackerAnnouncerResponsePeer

Copyright © 2018 www.massapicom. 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.