mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-13 11:09:39 +02:00
Significant improvement to Jingle logging messages, and a new SmackLogger that allows for use of java.commons.logging. Improvements to Jingle processing to keep up with recent changes in the XEPs as we approach approval of the standard. (There will be more changes as the standard changes.) Fixes to the way STUN gets used, and a new JSTUN library (including performance and reliability changes we added to it).
git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@10852 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
995f319f1e
commit
84fcf53512
40 changed files with 755 additions and 337 deletions
|
@ -14,8 +14,11 @@ import org.jivesoftware.smackx.jingle.media.JingleMediaManager;
|
|||
import org.jivesoftware.smackx.jingle.media.PayloadType;
|
||||
import org.jivesoftware.smackx.jingle.mediaimpl.test.TestMediaManager;
|
||||
|
||||
import java.net.NetworkInterface;
|
||||
import java.net.SocketException;
|
||||
import java.net.UnknownHostException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Enumeration;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
@ -129,10 +132,28 @@ public class STUNResolverTest extends SmackTestCase {
|
|||
cc.prioritizeCandidates();
|
||||
// get SortedCandidates
|
||||
|
||||
for (Candidate candidate : cc.getSortedCandidates())
|
||||
for (Candidate candidate : cc.getSortedCandidates()) {
|
||||
short nicNum = 0;
|
||||
try {
|
||||
Enumeration<NetworkInterface> nics = NetworkInterface.getNetworkInterfaces();
|
||||
short tempNic = 0;
|
||||
NetworkInterface nic = NetworkInterface.getByInetAddress(candidate.getAddress().getInetAddress());
|
||||
while(nics.hasMoreElements()) {
|
||||
NetworkInterface checkNIC = nics.nextElement();
|
||||
if (checkNIC.equals(nic)) {
|
||||
nicNum = tempNic;
|
||||
break;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
} catch (SocketException e1) {
|
||||
// TODO Auto-generated catch block
|
||||
e1.printStackTrace();
|
||||
}
|
||||
|
||||
try {
|
||||
TransportCandidate transportCandidate = new ICECandidate(candidate.getAddress().getInetAddress()
|
||||
.getHostAddress(), 1, candidate.getNetwork(), "1", candidate.getPort(), "1", candidate.getPriority(),
|
||||
.getHostAddress(), 1, nicNum, "1", candidate.getPort(), "1", candidate.getPriority(),
|
||||
ICECandidate.Type.prflx);
|
||||
transportCandidate.setLocalIp(candidate.getBase().getAddress().getInetAddress().getHostAddress());
|
||||
System.out.println("C: " + candidate.getAddress().getInetAddress() + "|"
|
||||
|
@ -142,6 +163,7 @@ public class STUNResolverTest extends SmackTestCase {
|
|||
} catch (UnknownHostException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
Candidate candidate = cc.getSortedCandidates().get(0);
|
||||
String temp = "C: " + candidate.getAddress().getInetAddress() + "|" + candidate.getBase().getAddress().getInetAddress()
|
||||
+ " p:" + candidate.getPriority();
|
||||
|
|
|
@ -36,11 +36,11 @@ public class JingleProviderTest extends SmackTestCase {
|
|||
|
||||
// Create a dummy packet for testing...
|
||||
IQfake iqSent = new IQfake (
|
||||
" <jingle xmlns='http://jabber.org/protocol/jingle'" +
|
||||
" <jingle xmlns='urn:xmpp:tmp:jingle'" +
|
||||
" initiator=\"gorrino@viejo.com\"" +
|
||||
" responder=\"colico@hepatico.com\"" +
|
||||
" action=\"transport-info\" sid=\"\">" +
|
||||
" <transport xmlns='http://jabber.org/protocol/jingle/transport/ice'>" +
|
||||
" <transport xmlns='urn:xmpp:tmp:jingle:transports:ice-udp'>" +
|
||||
" <candidate generation=\"1\"" +
|
||||
" ip=\"192.168.1.1\"" +
|
||||
" password=\"secret\"" +
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue