refreshActivity();
}
private void refreshGeneral() {
DHTControlStats controlStats = dht.getControl().getStats();
DHTRouterStats routerStats = dht.getRouter().getStats();
DHTTransport transport = dht.getTransport();
DHTTransportStats transportStats = transport.getStats();
lblUpTime.setText(TimeFormatter.format(controlStats.getRouterUptime() / 1000));
lblNumberOfUsers.setText("" + controlStats.getEstimatedDHTSize());
int percent = transportStats.getRouteablePercentage();
lblReachable.setText((transport.isReachable()?yes_str:no_str) + (percent==-1?"":(" " + percent+"%")));
DHTNATPuncher puncher = dht.getNATPuncher();
String puncher_str;
if ( puncher == null ){
puncher_str = "";
}else{
puncher_str = puncher.operational()?yes_str:no_str;
}
lblRendezvous.setText(transport.isReachable()?"":puncher_str);
long[] stats = routerStats.getStats();
lblNodes.setText("" + stats[DHTRouterStats.ST_NODES]);
lblLeaves.setText("" + stats[DHTRouterStats.ST_LEAVES]);
lblContacts.setText("" + stats[DHTRouterStats.ST_CONTACTS]);
lblReplacements.setText("" + stats[DHTRouterStats.ST_REPLACEMENTS]);
lblLive.setText("" + stats[DHTRouterStats.ST_CONTACTS_LIVE]);