1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-06-16 08:34:50 +02:00

Small Fixes in BridgedResolver

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@7768 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Thiago Camargo 2007-03-29 01:50:57 +00:00 committed by thiago
parent 19131e4934
commit f609189c11
2 changed files with 12 additions and 5 deletions

View file

@ -24,6 +24,8 @@ import org.jivesoftware.smack.XMPPException;
import org.jivesoftware.smackx.jingle.JingleSession; import org.jivesoftware.smackx.jingle.JingleSession;
import java.util.Random; import java.util.Random;
import java.net.InetAddress;
import java.net.UnknownHostException;
/** /**
* Bridged Resolver use a RTPBridge Service to add a relayed candidate. * Bridged Resolver use a RTPBridge Service to add a relayed candidate.
@ -65,17 +67,22 @@ public class BridgedResolver extends TransportResolver{
RTPBridge rtpBridge = RTPBridge.getRTPBridge(connection, String.valueOf(sid)); RTPBridge rtpBridge = RTPBridge.getRTPBridge(connection, String.valueOf(sid));
BasicResolver basicResolver = new BasicResolver();
basicResolver.initializeAndWait(); String localIp="127.0.0.1";
try {
localIp = InetAddress.getLocalHost().getHostAddress();
}
catch (UnknownHostException e) {
e.printStackTrace();
}
TransportCandidate localCandidate = new TransportCandidate.Fixed( TransportCandidate localCandidate = new TransportCandidate.Fixed(
rtpBridge.getIp(), rtpBridge.getPortA()); rtpBridge.getIp(), rtpBridge.getPortA());
localCandidate.setLocalIp(basicResolver.getCandidate(0).getLocalIp()); localCandidate.setLocalIp(localIp);
TransportCandidate remoteCandidate = new TransportCandidate.Fixed( TransportCandidate remoteCandidate = new TransportCandidate.Fixed(
rtpBridge.getIp(), rtpBridge.getPortB()); rtpBridge.getIp(), rtpBridge.getPortB());
remoteCandidate.setLocalIp(basicResolver.getCandidate(0).getLocalIp()); remoteCandidate.setLocalIp(localIp);
localCandidate.setSymmetric(remoteCandidate); localCandidate.setSymmetric(remoteCandidate);
remoteCandidate.setSymmetric(localCandidate); remoteCandidate.setSymmetric(localCandidate);

View file

@ -386,7 +386,7 @@ public abstract class TransportCandidate {
InetAddress candAddress; InetAddress candAddress;
try { try {
candAddress = InetAddress.getByName(getIp()); candAddress = InetAddress.getByName(getIp());
isUsable = candAddress.isReachable(TransportResolver.CHECK_TIMEOUT); isUsable = true;//candAddress.isReachable(TransportResolver.CHECK_TIMEOUT);
} }
catch (Exception e) { catch (Exception e) {
isUsable = false; isUsable = false;