Repairs condition for a check list to enter the COMPLETED state. Was: every component needs to have a nominated candidate, Is: Every component needs to have a nominated candidate whose nomination check has succeeded
This commit is contained in:
parent
69ed45c7d3
commit
5875d4dec1
12
build.xml
12
build.xml
@ -153,6 +153,18 @@
|
|||||||
</java>
|
</java>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
|
<!-- runs our sample distributed application -->
|
||||||
|
<target name="run-sample">
|
||||||
|
<java fork="true"
|
||||||
|
classname="test.Ice"
|
||||||
|
classpathref="project.class.path">
|
||||||
|
|
||||||
|
<!-- Tell java.util.logging about our logging preferences -->
|
||||||
|
<sysproperty key="java.util.logging.config.file"
|
||||||
|
value="lib/logging.properties"/>
|
||||||
|
</java>
|
||||||
|
</target>
|
||||||
|
|
||||||
<!-- runs our sample distributed application -->
|
<!-- runs our sample distributed application -->
|
||||||
<target name="run-dist">
|
<target name="run-dist">
|
||||||
<java fork="true"
|
<java fork="true"
|
||||||
|
|||||||
@ -51,5 +51,6 @@ java.util.logging.ConsoleHandler.formatter = org.ice4j.util.Ice4jLogFormatter
|
|||||||
|
|
||||||
# Things coming from ice4j
|
# Things coming from ice4j
|
||||||
org.ice4j.level = INFO
|
org.ice4j.level = INFO
|
||||||
org.ice4j.ice.checks.levell = FINEST
|
#org.ice4j.ice.checks.levell = FINEST
|
||||||
|
#org.ice4j.ice.ConnectivityCheckClient.level = FINER
|
||||||
|
|
||||||
|
|||||||
@ -1126,12 +1126,18 @@ public class Agent
|
|||||||
CheckList checkList = parentStream.getCheckList();
|
CheckList checkList = parentStream.getCheckList();
|
||||||
|
|
||||||
if( checkList.getState() == CheckListState.RUNNING )
|
if( checkList.getState() == CheckListState.RUNNING )
|
||||||
checkList.handleNomination(nominatedPair);
|
{
|
||||||
|
System.out.println("nomination confirmed for " + checkList.getName());
|
||||||
|
checkList.handleNominationConfirmed(nominatedPair);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
System.out.println("ignoring nomination confirmed for " + checkList.getName()
|
||||||
|
+ "because checklsitstate=" + checkList.getState() + " && pstreamcompleted=" + parentStream.allComponentsAreNominated());
|
||||||
|
|
||||||
//Once there is at least one nominated pair in the valid list for
|
//Once there is at least one nominated pair in the valid list for
|
||||||
//every component of the media stream and the state of the
|
//every component of the media stream and the state of the
|
||||||
//check list is Running
|
//check list is Running
|
||||||
if(parentStream.allComponentsAreNominated()
|
if(parentStream.allComponentsHaveSelected()
|
||||||
&& checkList.getState() == CheckListState.RUNNING)
|
&& checkList.getState() == CheckListState.RUNNING)
|
||||||
{
|
{
|
||||||
//The agent MUST change the state of processing for its check
|
//The agent MUST change the state of processing for its check
|
||||||
|
|||||||
@ -350,7 +350,8 @@ public class CheckList
|
|||||||
* @param nominatedPair the {@link CandidatePair} whose nomination we need
|
* @param nominatedPair the {@link CandidatePair} whose nomination we need
|
||||||
* to handle.
|
* to handle.
|
||||||
*/
|
*/
|
||||||
protected synchronized void handleNomination(CandidatePair nominatedPair)
|
protected synchronized void handleNominationConfirmed(
|
||||||
|
CandidatePair nominatedPair)
|
||||||
{
|
{
|
||||||
Component cmp = nominatedPair.getParentComponent();
|
Component cmp = nominatedPair.getParentComponent();
|
||||||
|
|
||||||
|
|||||||
@ -47,7 +47,7 @@ class ConnectivityCheckServer
|
|||||||
*
|
*
|
||||||
* @param parentAgent the <tt>Agent</tt> that is creating this instance.
|
* @param parentAgent the <tt>Agent</tt> that is creating this instance.
|
||||||
*/
|
*/
|
||||||
public ConnectivityCheckServer(Agent parentAgent)
|
public ConnectivityCheckServer(Agent parentAgent)
|
||||||
{
|
{
|
||||||
this.parentAgent = parentAgent;
|
this.parentAgent = parentAgent;
|
||||||
stunStack.addRequestListener(this);
|
stunStack.addRequestListener(this);
|
||||||
|
|||||||
@ -637,9 +637,9 @@ public class IceMediaStream
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns <tt>true</tt> if there is at least one nominated {@link
|
* Returns <tt>false</tt> if there is at least one nominated {@link
|
||||||
* CandidatePair} in the valid list for every {@link Component} of this
|
* CandidatePair} in the valid list for every {@link Component} of this
|
||||||
* stream and <tt>false</tt> otherwise.
|
* stream and <tt>true</tt> otherwise.
|
||||||
*
|
*
|
||||||
* @return <tt>true</tt> if there is at least one nominated {@link
|
* @return <tt>true</tt> if there is at least one nominated {@link
|
||||||
* CandidatePair} in the valid list for every {@link Component} of this
|
* CandidatePair} in the valid list for every {@link Component} of this
|
||||||
@ -659,6 +659,26 @@ public class IceMediaStream
|
|||||||
return components.size() == 0;
|
return components.size() == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns <tt>false</tt> if there is at least one nominated {@link
|
||||||
|
* CandidatePair} who doesn't have a selected address yet, and <tt>true</tt>
|
||||||
|
* otherwise.
|
||||||
|
*
|
||||||
|
* @return <tt>false</tt> if there is at least one nominated {@link
|
||||||
|
* CandidatePair} who doesn't have a selected address yet, and <tt>true</tt>
|
||||||
|
* otherwise.
|
||||||
|
*/
|
||||||
|
protected boolean allComponentsHaveSelected()
|
||||||
|
{
|
||||||
|
List<Component> components = getComponents();
|
||||||
|
|
||||||
|
for(Component component : components)
|
||||||
|
if(component.getSelectedPair() == null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the first {@link CandidatePair} stored in this stream's valid
|
* Returns the first {@link CandidatePair} stored in this stream's valid
|
||||||
* list, that belongs to the specified <tt>component</tt>.
|
* list, that belongs to the specified <tt>component</tt>.
|
||||||
|
|||||||
@ -49,26 +49,26 @@ class StunClientTransaction
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Maximum number of retransmissions. Once this number is reached and if no
|
* Maximum number of retransmissions. Once this number is reached and if no
|
||||||
* response is received after MAX_WAIT_INTERVAL miliseconds the request is
|
* response is received after MAX_WAIT_INTERVAL milliseconds the request is
|
||||||
* considered unanswered.
|
* considered unanswered.
|
||||||
*/
|
*/
|
||||||
public int maxRetransmissions = DEFAULT_MAX_RETRANSMISSIONS;
|
public int maxRetransmissions = DEFAULT_MAX_RETRANSMISSIONS;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The number of miliseconds a client should wait before retransmitting,
|
* The number of milliseconds a client should wait before retransmitting,
|
||||||
* after it has sent a request for the first time.
|
* after it has sent a request for the first time.
|
||||||
*/
|
*/
|
||||||
public static final int DEFAULT_ORIGINAL_WAIT_INTERVAL = 100;
|
public static final int DEFAULT_ORIGINAL_WAIT_INTERVAL = 100;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The number of miliseconds to wait before the first retansmission of the
|
* The number of milliseconds to wait before the first retransmission of the
|
||||||
* request.
|
* request.
|
||||||
*/
|
*/
|
||||||
public int originalWaitInterval = DEFAULT_ORIGINAL_WAIT_INTERVAL;
|
public int originalWaitInterval = DEFAULT_ORIGINAL_WAIT_INTERVAL;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The maximum number of miliseconds a client should wait between
|
* The maximum number of milliseconds a client should wait between
|
||||||
* consecutive retransmissionse, after it has sent a request for the first
|
* consecutive retransmissions, after it has sent a request for the first
|
||||||
* time.
|
* time.
|
||||||
*/
|
*/
|
||||||
public static final int DEFAULT_MAX_WAIT_INTERVAL = 1600;
|
public static final int DEFAULT_MAX_WAIT_INTERVAL = 1600;
|
||||||
@ -291,10 +291,9 @@ class StunClientTransaction
|
|||||||
logger.finer("Trying to resend a cancelled transaction.");
|
logger.finer("Trying to resend a cancelled transaction.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
stackCallback.getNetAccessManager().sendMessage(
|
stackCallback.getNetAccessManager().sendMessage(
|
||||||
this.request,
|
this.request, localAddress, requestDestination);
|
||||||
localAddress,
|
|
||||||
requestDestination);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -287,8 +287,8 @@ public class Ice
|
|||||||
+ (endTime - startTime) +" ms");
|
+ (endTime - startTime) +" ms");
|
||||||
startTime = endTime;
|
startTime = endTime;
|
||||||
//rtcpComp
|
//rtcpComp
|
||||||
//agent.createComponent(
|
agent.createComponent(
|
||||||
// stream, Transport.UDP, rtpPort + 1, rtpPort + 1, rtpPort + 101);
|
stream, Transport.UDP, rtpPort + 1, rtpPort + 1, rtpPort + 101);
|
||||||
|
|
||||||
endTime = System.currentTimeMillis();
|
endTime = System.currentTimeMillis();
|
||||||
System.out.println("RTCP Component created in "
|
System.out.println("RTCP Component created in "
|
||||||
|
|||||||
@ -34,8 +34,6 @@ public class IceDistributed
|
|||||||
*/
|
*/
|
||||||
public static void main(String[] args) throws Throwable
|
public static void main(String[] args) throws Throwable
|
||||||
{
|
{
|
||||||
startTime = System.currentTimeMillis();
|
|
||||||
|
|
||||||
Agent localAgent = createAgent(2020);
|
Agent localAgent = createAgent(2020);
|
||||||
localAgent.setNominationStrategy(
|
localAgent.setNominationStrategy(
|
||||||
NominationStrategy.NOMINATE_HIGHEST_PRIO);
|
NominationStrategy.NOMINATE_HIGHEST_PRIO);
|
||||||
@ -56,6 +54,7 @@ public class IceDistributed
|
|||||||
|
|
||||||
String sdp = readSDP();
|
String sdp = readSDP();
|
||||||
|
|
||||||
|
startTime = System.currentTimeMillis();
|
||||||
SdpUtils.parseSDP(localAgent, sdp);
|
SdpUtils.parseSDP(localAgent, sdp);
|
||||||
|
|
||||||
localAgent.startConnectivityEstablishment();
|
localAgent.startConnectivityEstablishment();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user