synchronized(sentPackets) {
Iterator<Map.Entry<Integer, SentPacket>> it = sentPackets.entrySet().iterator();
while(it.hasNext()) {
Map.Entry<Integer, SentPacket> e = it.next();
SentPacket s = e.getValue();
if (s.getSentTime() < threshold) {
if (logMINOR) {
Logger.minor(this, "Assuming packet " + e.getKey() + " has been lost. "
+ "Delay " + (curTime - s.getSentTime()) + "ms, "
+ "threshold " + threshold + "ms");
}
// Store the packet sentTime in our lost sent times cache, so we can calculate
// RTT if an ack may surface later on.
if(!s.messages.isEmpty()) {
lostSentTimes.report(e.getKey(), s.getSentTime());
}
// Mark the packet as lost and remove it from our active packets.
s.lost();
it.remove();
bigLostCount++;
} else {
count++;
}