1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-06-25 21:14:51 +02:00

Fixes and Fixes

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@7452 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Thiago Camargo 2007-03-11 01:28:44 +00:00 committed by thiago
parent 9ea6a38249
commit 4a86390b17
7 changed files with 23 additions and 9 deletions

View file

@ -310,6 +310,7 @@ public class IncomingJingleSession extends JingleSession {
.getBestCommonAudioPt();
TransportCandidate bestRemoteCandidate = getTransportNeg()
.getBestRemoteCandidate();
TransportCandidate acceptedLocalCandidate = getTransportNeg()
.getAcceptedLocalCandidate();

View file

@ -1072,6 +1072,10 @@ public abstract class JingleSession extends JingleNegotiator {
jingleMediaSession.startTrasmit();
jingleMediaSession.startReceive();
for (TransportCandidate candidate : this.getTransportNeg().getOfferedCandidates())
candidate.removeCandidateEcho();
}
}

View file

@ -257,6 +257,12 @@ public class ICECandidate extends TransportCandidate implements Comparable {
// Media Proxy don´t have Echo features.
// If its a relayed candidate we assumpt that is Checked.
if (getType().equals("relay")) {
try {
Thread.sleep(TransportNegotiator.CANDIDATES_ACCEPT_PERIOD*2);
}
catch (InterruptedException e) {
// Do Nothing
}
triggerCandidateChecked(true);
return;
}

View file

@ -668,7 +668,7 @@ public abstract class TransportCandidate {
socket.receive(packet);
System.out.println("ECHO Packet Received in: " + socket.getLocalAddress().getHostAddress() + ":" + socket.getLocalPort() + " From: " + packet.getAddress().getHostAddress() + ":" + packet.getPort());
//System.out.println("ECHO Packet Received in: " + socket.getLocalAddress().getHostAddress() + ":" + socket.getLocalPort() + " From: " + packet.getAddress().getHostAddress() + ":" + packet.getPort());
for (DatagramListener listener : listeners) {
listener.datagramReceived(packet);

View file

@ -52,7 +52,7 @@ public abstract class TransportNegotiator extends JingleNegotiator {
// The time we give to the candidates check before we accept or decline the
// transport (in milliseconds)
private final static int CANDIDATES_ACCEPT_PERIOD = 3000;
public final static int CANDIDATES_ACCEPT_PERIOD = 3000;
// The session this nenotiator belongs to
private final JingleSession session;
@ -171,6 +171,10 @@ public abstract class TransportNegotiator extends JingleNegotiator {
}
public List<TransportCandidate> getOfferedCandidates() {
return offeredCandidates;
}
/**
* Obtain the best common transport candidate obtained in the negotiation.
*
@ -559,7 +563,7 @@ public abstract class TransportNegotiator extends JingleNegotiator {
JingleListener li = (JingleListener) listener;
if (li instanceof JingleTransportListener) {
JingleTransportListener mli = (JingleTransportListener) li;
System.out.println("triggerTransportEstablished " + local.getLocalIp());
System.out.println("triggerTransportEstablished " + local.getLocalIp() + ":" + local.getPort() + "|" + remote.getIp() + ":" + remote.getPort());
mli.transportEstablished(local, remote);
}
}
@ -748,11 +752,6 @@ 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();
@ -807,6 +806,7 @@ public abstract class TransportNegotiator extends JingleNegotiator {
// Hopefully, we only have one validRemoteCandidate
ArrayList cands = getValidRemoteCandidatesList();
if (!cands.isEmpty()) {
System.out.println("RAW CAND");
return (TransportCandidate) cands.get(0);
}
else {
@ -872,6 +872,9 @@ public abstract class TransportNegotiator extends JingleNegotiator {
result = chose;
}
if (result != null && result.getType().equals("relay"))
System.out.println("Relay Type");
return result;
}

View file

@ -96,7 +96,7 @@ public class JingleMediaTest extends SmackTestCase {
js0.start();
Thread.sleep(10000);
Thread.sleep(50000);
js0.terminate();
jm1.removeJingleSessionRequestListener(jingleSessionRequestListener);