예제 #1
0
  public InetAddress getRmtAddress() {
    if (rmtAddress == null) {
      rmtAddress = Util.getInetAddress(rmt_ip);
    }

    return rmtAddress;
  }
예제 #2
0
파일: Main.java 프로젝트: nologic/nabs
  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();
  }