Example #1
0
 public boolean isCompleted() {
   for (OutgoingSpeedCheckConnection c : connections) {
     if (!c.isCompleted()) {
       return false;
     }
   }
   return true;
 }
Example #2
0
 public int getGoodServers() {
   int num = 0;
   for (OutgoingSpeedCheckConnection c : connections) {
     if (c.getRemoteEstimate() > 0) {
       num++;
     }
   }
   return num;
 }
Example #3
0
 public void close() {
   for (OutgoingSpeedCheckConnection c : connections) {
     try {
       c.closeSocket();
     } catch (IOException e) {
       // TODO Auto-generated catch block
       e.printStackTrace();
     }
   }
 }
Example #4
0
 public int getRemoteEstimate() {
   if (remoteEstimate != -1) {
     return remoteEstimate;
   }
   int totalSpeed = 0;
   synchronized (connections) {
     for (OutgoingSpeedCheckConnection c : connections) {
       totalSpeed += c.getRemoteEstimate();
     }
   }
   return totalSpeed;
 }