Esempio n. 1
0
  public InetAddress getRmtAddress() {
    if (rmtAddress == null) {
      rmtAddress = Util.getInetAddress(rmt_ip);
    }

    return rmtAddress;
  }
Esempio n. 2
0
  public void updateStatus(InputStream in) throws IOException {
    DataInputStream din = new DataInputStream(in);
    Set curSet = new HashSet(ipToHost.keySet());

    int count = din.readInt();
    for (int i = 0; i < count; i++) {
      long ip = din.readLong();
      tmpLong.setLong(ip);
      Host host = (Host) ipToHost.get(tmpLong);
      if (host == null) {
        addHost(ip, Util.getInetAddress(ip));
        host = (Host) ipToHost.get(tmpLong);
      }

      curSet.remove(tmpLong);

      host.readHost(din);
      host.updateData();
    }

    Iterator it = curSet.iterator();
    while (it.hasNext()) {
      Long elem = (Long) it.next();
      removeHost(elem.longValue());
    }

    hostsHolder.revalidate();
    hostsHolder.repaint();
  }