Implements client side support for Updating Pair States (RFC 5245: Section 7.1.3.2.3). So did the previous commit despite the wrong commit message

This commit is contained in:
emcho 2010-05-08 21:36:58 +00:00
parent 5067c4a462
commit 988de3fbff
2 changed files with 14 additions and 12 deletions

View File

@ -643,7 +643,6 @@ public class Agent
if (list != null) if (list != null)
list.recomputePairPriorities(); list.recomputePairPriorities();
} }
} }
/** /**

View File

@ -332,17 +332,16 @@ public class ConnectivityCheckClient
boolean wasFrozen = checkList.isFrozen(); boolean wasFrozen = checkList.isFrozen();
for(CandidatePair pair : checkList) for(CandidatePair pair : checkList)
if (parentStream.containsFoundation(pair.getFoundation())) if (parentStream.containsFoundation(pair.getFoundation())
&& pair.getState() == CandidatePairState.FROZEN)
pair.setStateWaiting(); pair.setStateWaiting();
//if the checklList is still frozen after the above operations, and //if the checklList is still frozen after the above operations,
//there are no pairs in the check list whose foundation matches a //the agent groups together all of the pairs with the same
//pair in the valid list under consideration, the agent groups //foundation, and for each group, sets the state of the pair with
//together all of the pairs with the same foundation, and for each //the lowest component ID to Waiting. If there is more than one
//group, sets the state of the pair with the lowest component ID to //such pair, the one with the highest priority is used.
//Waiting. If there is more than one such pair, the one with the if(checkList.isFrozen())
//highest priority is used.
if(!checkList.isFrozen())
checkList.computeInitialCheckListPairStates(); checkList.computeInitialCheckListPairStates();
if (wasFrozen) if (wasFrozen)
@ -375,8 +374,12 @@ public class ConnectivityCheckClient
CandidatePair pair = ((CandidatePair)evt.getTransactionID() CandidatePair pair = ((CandidatePair)evt.getTransactionID()
.getApplicationData()); .getApplicationData());
return pair.getLocalCandidate().equals(evt.getLocalAddress()) boolean sym = pair.getLocalCandidate().getTransportAddress()
&& pair.getRemoteCandidate().equals(evt.getRemoteAddress()); .equals(evt.getLocalAddress())
&& pair.getRemoteCandidate().getTransportAddress()
.equals(evt.getRemoteAddress());
return sym;
} }
/** /**