Renames the "reachable" flag to "alive" and adds additional comments explaining its purpose and usage.

This commit is contained in:
gp 2015-03-19 11:15:26 +00:00
parent b564f06732
commit 03c5f7c162
3 changed files with 22 additions and 10 deletions

View File

@ -1726,8 +1726,8 @@ public class Agent
{ {
//all lists ended but none succeeded. No love today ;( //all lists ended but none succeeded. No love today ;(
if (logger.isLoggable(Level.INFO)) { if (logger.isLoggable(Level.INFO)) {
if (connCheckClient.isReachable() if (connCheckClient.isAlive()
|| connCheckServer.isReachable()) || connCheckServer.isAlive())
{ {
logger.info("Suspicious ICE connectivity failure. Checks" + logger.info("Suspicious ICE connectivity failure. Checks" +
" failed but the remote end was able to reach us."); " failed but the remote end was able to reach us.");

View File

@ -57,17 +57,23 @@ class ConnectivityCheckClient
/** /**
* A flag that determines whether we have received a STUN response or not. * A flag that determines whether we have received a STUN response or not.
*/ */
private boolean reachable = false; private boolean alive = false;
/** /**
* Returns a boolean value indicating whether we have received a STUN * Returns a boolean value indicating whether we have received a STUN
* response or not. * response or not.
* *
* Note that this should NOT be taken as an indication that the negotiation
* has succeeded, it merely indicates that we have received ANY STUN
* response, possibly a BINDING_ERROR_RESPONSE. It is completely
* unrelated/independent from the ICE spec and it's only meant to be used
* for debugging purposes.
*
* @return a boolean value indicating whether we have received a STUN * @return a boolean value indicating whether we have received a STUN
* response or not. * response or not.
*/ */
public boolean isReachable() { public boolean isAlive() {
return reachable; return alive;
} }
/** /**
@ -337,7 +343,7 @@ class ConnectivityCheckClient
*/ */
public void processResponse(StunResponseEvent ev) public void processResponse(StunResponseEvent ev)
{ {
reachable = true; alive = true;
CandidatePair checkedPair CandidatePair checkedPair
= (CandidatePair) ev.getTransactionID().getApplicationData(); = (CandidatePair) ev.getTransactionID().getApplicationData();

View File

@ -51,17 +51,23 @@ class ConnectivityCheckServer
/** /**
* A flag that determines whether we have received a STUN request or not. * A flag that determines whether we have received a STUN request or not.
*/ */
private boolean reachable = false; private boolean alive = false;
/** /**
* Returns a boolean value indicating whether we have received a STUN * Returns a boolean value indicating whether we have received a STUN
* request or not. * request or not.
* *
* Note that this should NOT be taken as an indication that the negotiation
* has succeeded, it merely indicates that we have received ANY STUN
* request, even invalid ones (e.g. with the wrong username or ufrag). It is
* completely unrelated/independent from the ICE spec and it's only meant to
* be used for debugging purposes.
*
* @return a boolean value indicating whether we have received a STUN * @return a boolean value indicating whether we have received a STUN
* request or not. * request or not.
*/ */
public boolean isReachable() { public boolean isAlive() {
return reachable; return alive;
} }
/** /**
@ -98,7 +104,7 @@ class ConnectivityCheckServer
if(logger.isLoggable(Level.FINER)) if(logger.isLoggable(Level.FINER))
logger.finer("Received request " + evt); logger.finer("Received request " + evt);
reachable = true; alive = true;
Request request = (Request)evt.getMessage(); Request request = (Request)evt.getMessage();