1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-27 00:32:07 +01: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(); .getBestCommonAudioPt();
TransportCandidate bestRemoteCandidate = getTransportNeg() TransportCandidate bestRemoteCandidate = getTransportNeg()
.getBestRemoteCandidate(); .getBestRemoteCandidate();
TransportCandidate acceptedLocalCandidate = getTransportNeg() TransportCandidate acceptedLocalCandidate = getTransportNeg()
.getAcceptedLocalCandidate(); .getAcceptedLocalCandidate();

View file

@ -1072,6 +1072,10 @@ public abstract class JingleSession extends JingleNegotiator {
jingleMediaSession.startTrasmit(); jingleMediaSession.startTrasmit();
jingleMediaSession.startReceive(); 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. // Media Proxy don´t have Echo features.
// If its a relayed candidate we assumpt that is Checked. // If its a relayed candidate we assumpt that is Checked.
if (getType().equals("relay")) { if (getType().equals("relay")) {
try {
Thread.sleep(TransportNegotiator.CANDIDATES_ACCEPT_PERIOD*2);
}
catch (InterruptedException e) {
// Do Nothing
}
triggerCandidateChecked(true); triggerCandidateChecked(true);
return; return;
} }

View file

@ -668,7 +668,7 @@ public abstract class TransportCandidate {
socket.receive(packet); 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) { for (DatagramListener listener : listeners) {
listener.datagramReceived(packet); 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 // The time we give to the candidates check before we accept or decline the
// transport (in milliseconds) // 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 // The session this nenotiator belongs to
private final JingleSession session; 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. * Obtain the best common transport candidate obtained in the negotiation.
* *
@ -559,7 +563,7 @@ public abstract class TransportNegotiator extends JingleNegotiator {
JingleListener li = (JingleListener) listener; JingleListener li = (JingleListener) listener;
if (li instanceof JingleTransportListener) { if (li instanceof JingleTransportListener) {
JingleTransportListener mli = (JingleTransportListener) li; 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); mli.transportEstablished(local, remote);
} }
} }
@ -748,11 +752,6 @@ public abstract class TransportNegotiator extends JingleNegotiator {
*/ */
public void eventEnter() { public void eventEnter() {
System.out.println("Transport stabilished"); System.out.println("Transport stabilished");
for (TransportCandidate transportCandidate : offeredCandidates)
if (transportCandidate.getCandidateEcho() != null)
transportCandidate.removeCandidateEcho();
triggerTransportEstablished(getAcceptedLocalCandidate(), triggerTransportEstablished(getAcceptedLocalCandidate(),
getBestRemoteCandidate()); getBestRemoteCandidate());
super.eventEnter(); super.eventEnter();
@ -807,6 +806,7 @@ public abstract class TransportNegotiator extends JingleNegotiator {
// Hopefully, we only have one validRemoteCandidate // Hopefully, we only have one validRemoteCandidate
ArrayList cands = getValidRemoteCandidatesList(); ArrayList cands = getValidRemoteCandidatesList();
if (!cands.isEmpty()) { if (!cands.isEmpty()) {
System.out.println("RAW CAND");
return (TransportCandidate) cands.get(0); return (TransportCandidate) cands.get(0);
} }
else { else {
@ -872,6 +872,9 @@ public abstract class TransportNegotiator extends JingleNegotiator {
result = chose; result = chose;
} }
if (result != null && result.getType().equals("relay"))
System.out.println("Relay Type");
return result; return result;
} }

View file

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