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