Package net.tomp2p.peers

Examples of net.tomp2p.peers.PeerStatistic


   
    Random random = new Random();
    List<PeerStatistic> keys = new ArrayList<PeerStatistic>(peers.peerAddresses().keySet());
   
    for(int i=0; i<size && !keys.isEmpty(); i++) {
      PeerStatistic key = keys.get( random.nextInt(keys.size()) );
      Data value = peers.peerAddresses().get(key);
      if(value != null) {
        retVal.put(key, value);
      } else {
        //not there anymore
View Full Code Here


      }
      Collection<PeerStatistic> peerStatatistics = trackerData.peerAddresses().keySet();
      if (peerStatatistics == null || peerStatatistics.size() == 0) {
        return null;
      }
      peerStatatistics.remove(new PeerStatistic(self));
      if (peerStatatistics.size() == 0) {
        return null;
      }
      PeerStatistic peerStatatistic = Utils.pollRandom(peerStatatistics, rnd);
      return new TrackerTriple().key(key).data(trackerData).remotePeer(peerStatatistic.peerAddress());
    }
View Full Code Here

TOP

Related Classes of net.tomp2p.peers.PeerStatistic

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.