Package org.jmule.core.networkmanager

Examples of org.jmule.core.networkmanager.InternalNetworkManager


    return this.tag_list;
  }
 
  public float getDownloadSpeed() {
    if (!isConnected()) return 0;
    InternalNetworkManager network_manager = (InternalNetworkManager) NetworkManagerSingleton
        .getInstance();
    if (!network_manager.hasPeer(getIP(), getPort())) {
      return 0;
    }
    return network_manager.getPeerDownloadSpeed(getIP(), getPort());
  }
View Full Code Here


    return network_manager.getPeerDownloadSpeed(getIP(), getPort());
  }

  public float getUploadSpeed() {
    if (!isConnected()) return 0;
    InternalNetworkManager network_manager = (InternalNetworkManager) NetworkManagerSingleton
        .getInstance();
    return network_manager.getPeerUploadSpeed(getIP(), getPort());
  }
View Full Code Here

  }

  public float getDownloadServiceSpeed() {
    if (!isConnected()) return 0;
    System.out.println("getDownloadServiceSpeed : " + this);
    InternalNetworkManager network_manager = (InternalNetworkManager) NetworkManagerSingleton
        .getInstance();
    return network_manager.getPeerDownloadServiceSpeed(getIP(), getPort());
  }
View Full Code Here

        .getInstance();
    return network_manager.getPeerDownloadServiceSpeed(getIP(), getPort());
  }

  public float getUploadServiceSpeed() {
    InternalNetworkManager network_manager = (InternalNetworkManager) NetworkManagerSingleton
        .getInstance();
    return network_manager.getPeerUploadServiceSpeed(getIP(), getPort());
  }
View Full Code Here

    usedContacts.addAll(contactList);
   
    for(KadContact contact : contactList) {
      bootStrapContacts.add(contact);
      usedContacts.add(contact);
      InternalNetworkManager x = (InternalNetworkManager) NetworkManagerSingleton.getInstance();
      if (routingTable.getTotalContacts()<MIN_CONTACTS_TO_SEND_BOOTSTRAP) {       
        KadPacket packet;
        try {
          packet = PacketFactory.getBootStrap1ReqPacket();
          x.sendKadPacket(packet, contact.getIPAddress(), contact.getUDPPort());
        } catch (JMException e) {
          e.printStackTrace();
        }
       
      } else {
        KadPacket packet;
        try {
          packet = PacketFactory.getHello2ReqPacket(org.jmule.core.edonkey.packet.tag.TagList.EMPTY_TAG_LIST);
          x.sendKadPacket(packet, contact.getIPAddress(), contact.getUDPPort());
        } catch (JMException e) {
          e.printStackTrace();
        }
       
      }
View Full Code Here

TOP

Related Classes of org.jmule.core.networkmanager.InternalNetworkManager

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.