From c3c44e142d64ecaf38189563e214ad947aeaf3cb Mon Sep 17 00:00:00 2001 From: Thiago Camargo Date: Fri, 9 Mar 2007 22:04:14 +0000 Subject: [PATCH] Remove ECHO for Candidates after a Session Establishment git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@7442 b35dd754-fafc-0310-a699-88a17e54d16e --- .../smackx/jingle/nat/TransportCandidate.java | 4 ++-- .../smackx/jingle/nat/TransportNegotiator.java | 9 +++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/jingle/extension/source/org/jivesoftware/smackx/jingle/nat/TransportCandidate.java b/jingle/extension/source/org/jivesoftware/smackx/jingle/nat/TransportCandidate.java index 9030e5844..a26aad856 100644 --- a/jingle/extension/source/org/jivesoftware/smackx/jingle/nat/TransportCandidate.java +++ b/jingle/extension/source/org/jivesoftware/smackx/jingle/nat/TransportCandidate.java @@ -760,7 +760,7 @@ public abstract class TransportCandidate { } } catch (IOException e) { - e.printStackTrace(); + // Do Nothing } this.removeListener(listener); @@ -778,7 +778,7 @@ public abstract class TransportCandidate { public class TestResults { - private boolean result; + private boolean result=false; public boolean isReachable() { return result; diff --git a/jingle/extension/source/org/jivesoftware/smackx/jingle/nat/TransportNegotiator.java b/jingle/extension/source/org/jivesoftware/smackx/jingle/nat/TransportNegotiator.java index 143f88bad..c5de30efd 100644 --- a/jingle/extension/source/org/jivesoftware/smackx/jingle/nat/TransportNegotiator.java +++ b/jingle/extension/source/org/jivesoftware/smackx/jingle/nat/TransportNegotiator.java @@ -278,8 +278,8 @@ public abstract class TransportNegotiator extends JingleNegotiator { // Sleep for some time, waiting for the candidates checks - int totalTime= (CANDIDATES_ACCEPT_PERIOD + (TransportResolver.CHECK_TIMEOUT * (resolver.getCandidatesList().size()+1))); - int tries = (int)Math.ceil(totalTime/1000); + int totalTime = (CANDIDATES_ACCEPT_PERIOD + (TransportResolver.CHECK_TIMEOUT * (resolver.getCandidatesList().size() + 1))); + int tries = (int) Math.ceil(totalTime / 1000); for (int i = 0; i < tries; i++) { try { @@ -747,6 +747,11 @@ public abstract class TransportNegotiator extends JingleNegotiator { */ public void eventEnter() { System.out.println("Transport stabilished"); + + for (TransportCandidate transportCandidate : offeredCandidates) + if (transportCandidate.getCandidateEcho() != null) + transportCandidate.removeCandidateEcho(); + triggerTransportEstablished(getAcceptedLocalCandidate(), getBestRemoteCandidate()); super.eventEnter();