mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-22 20:12:07 +01:00
Candidate Class Fixes
git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@7499 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
879eab6e9d
commit
d7a8aafba2
3 changed files with 38 additions and 8 deletions
|
@ -270,12 +270,6 @@ public class ICECandidate extends TransportCandidate implements Comparable {
|
|||
if (testResult.isReachable() && checkingCandidate.equals(candidate)) {
|
||||
result.setResult(true);
|
||||
System.out.println("RESULT>>>OK:" + candidate.getIp() + ":" + candidate.getPort());
|
||||
for (TransportCandidate c : localCandidates) {
|
||||
CandidateEcho echo = candidate.getCandidateEcho();
|
||||
if (echo != null) {
|
||||
echo.removeResultListener(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -308,6 +302,13 @@ public class ICECandidate extends TransportCandidate implements Comparable {
|
|||
e.printStackTrace();
|
||||
}
|
||||
|
||||
for (TransportCandidate candidate : localCandidates) {
|
||||
CandidateEcho echo = candidate.getCandidateEcho();
|
||||
if (echo != null) {
|
||||
echo.removeResultListener(resultListener);
|
||||
}
|
||||
}
|
||||
|
||||
triggerCandidateChecked(result.isReachable());
|
||||
|
||||
//TODO candidate is being checked trigger
|
||||
|
@ -382,6 +383,29 @@ public class ICECandidate extends TransportCandidate implements Comparable {
|
|||
else if (!getUsername().equals(other.getUsername())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (getIp() == null) {
|
||||
if (other.getIp() != null) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (!getIp().equals(other.getIp())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (getPort() != other.getPort()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (getType() == null) {
|
||||
if (other.getType() != null) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (!getType().equals(other.getType())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -353,6 +353,11 @@ public abstract class TransportCandidate {
|
|||
else if (!getIp().equals(other.getIp())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (getPort() != other.getPort()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (getName() == null) {
|
||||
if (other.getName() != null) {
|
||||
return false;
|
||||
|
|
|
@ -147,7 +147,8 @@ public abstract class TransportNegotiator extends JingleNegotiator {
|
|||
throws XMPPException {
|
||||
for (int i = 0; i < resolver.getCandidateCount(); i++) {
|
||||
//TODO FIX The EQUAL Sentence
|
||||
if (resolver.getCandidate(i).getIp().equals(bestLocalCandidate.getIp())) {
|
||||
if (resolver.getCandidate(i).getIp().equals(bestLocalCandidate.getIp())
|
||||
&& resolver.getCandidate(i).getPort() == bestLocalCandidate.getPort()) {
|
||||
acceptedLocalCandidate = resolver.getCandidate(i);
|
||||
return;
|
||||
}
|
||||
|
@ -384,7 +385,7 @@ public abstract class TransportNegotiator extends JingleNegotiator {
|
|||
// Add the candidate to the list
|
||||
if (remoteCandidate != null) {
|
||||
synchronized (validRemoteCandidates) {
|
||||
System.out.println("ADDED Valid Cand: " + remoteCandidate.getIp());
|
||||
System.out.println("ADDED Valid Cand: " + remoteCandidate.getIp() + ":" + remoteCandidate.getPort());
|
||||
validRemoteCandidates.add(remoteCandidate);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue