Package org.jmule.core.edonkey.packet.tag

Examples of org.jmule.core.edonkey.packet.tag.ShortTag


      InternalJKadManager _jkad_manager = (InternalJKadManager) JKadManagerSingleton.getInstance();
      ConfigurationManager config_manager = ConfigurationManagerSingleton.getInstance();
      TagList tagList = new TagList();
      tagList.addTag(new IntTag(JKadConstants.TAG_SOURCEIP, Convert.byteToInt(_jkad_manager.getIPAddress().getAddress())));
      try {
        tagList.addTag(new ShortTag(JKadConstants.TAG_SOURCEPORT, Convert.intToShort(config_manager.getTCP())));
      } catch (ConfigurationManagerException e) {
        e.printStackTrace();
        _jkad_manager.disconnect();
      }
      try {
        tagList.addTag(new ShortTag(JKadConstants.TAG_SOURCEUPORT, Convert.intToShort(config_manager.getUDP())));
      } catch (ConfigurationManagerException e) {
        e.printStackTrace();
        _jkad_manager.disconnect();
      }
      tagList.addTag(new IntTag(JKadConstants.TAG_FILESIZE, Convert.longToInt(file.length())));
View Full Code Here


  public Source(ClientID clientID, IPAddress address, int udpPort, int tcpPort) {
    creationTime = System.currentTimeMillis();
    this.clientID = clientID;
    tagList = new TagList();
    tagList.addTag(new IntTag(JKadConstants.TAG_SOURCEIP,Convert.byteToInt(address.getAddress())));
    tagList.addTag(new ShortTag(JKadConstants.TAG_SOURCEPORT,Convert.intToShort(tcpPort)));
    tagList.addTag(new ShortTag(JKadConstants.TAG_SOURCEUPORT,Convert.intToShort(udpPort)));
  }
View Full Code Here

    return (Integer)object;
  }

  public void setUDPPort(int udpPort) {
    tagList.removeTag(JKadConstants.TAG_SOURCEUPORT);
    tagList.addTag(new ShortTag(JKadConstants.TAG_SOURCEUPORT,Convert.intToShort(udpPort)));
  }
View Full Code Here

    return (Integer)object;
  }

  public void setTCPPort(int tcpPort) {
    tagList.removeTag(JKadConstants.TAG_SOURCEPORT);
    tagList.addTag(new ShortTag(JKadConstants.TAG_SOURCEPORT,Convert.intToShort(tcpPort)));
  }
View Full Code Here

TOP

Related Classes of org.jmule.core.edonkey.packet.tag.ShortTag

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.