1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-23 14:52:06 +01:00

Delays Tunning

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@7481 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Thiago Camargo 2007-03-13 01:39:18 +00:00 committed by thiago
parent 9f3842bb8c
commit deab89d251
2 changed files with 5 additions and 6 deletions

View file

@ -302,7 +302,7 @@ public class ICECandidate extends TransportCandidate implements Comparable {
for (int i = 0; i < 10 && !result.isReachable(); i++) for (int i = 0; i < 10 && !result.isReachable(); i++)
try { try {
System.err.println(i); System.err.println(i);
Thread.sleep(300); Thread.sleep(400);
} }
catch (InterruptedException e) { catch (InterruptedException e) {
e.printStackTrace(); e.printStackTrace();

View file

@ -661,7 +661,8 @@ public abstract class TransportCandidate {
List<ResultListener> resultListeners = new ArrayList<ResultListener>(); List<ResultListener> resultListeners = new ArrayList<ResultListener>();
boolean enabled = true; boolean enabled = true;
boolean ended = false; boolean ended = false;
long tries = 2; long replyTries = 2;
long tries = 10;
TransportCandidate candidate = null; TransportCandidate candidate = null;
public CandidateEcho(TransportCandidate candidate, JingleSession session) throws UnknownHostException, SocketException { public CandidateEcho(TransportCandidate candidate, JingleSession session) throws UnknownHostException, SocketException {
@ -718,9 +719,7 @@ public abstract class TransportCandidate {
if (accept) break; if (accept) break;
} }
long delay = 200 / tries / 2; long delay = 100 / replyTries;
if (delay < 0) delay = 10;
String str[] = new String(packet.getData(), "UTF-8").split(";"); String str[] = new String(packet.getData(), "UTF-8").split(";");
String pass = str[0]; String pass = str[0];
@ -743,7 +742,7 @@ public abstract class TransportCandidate {
packet.setAddress(InetAddress.getByName(ip)); packet.setAddress(InetAddress.getByName(ip));
packet.setPort(Integer.parseInt(port)); packet.setPort(Integer.parseInt(port));
for (int i = 0; i < tries; i++) { for (int i = 0; i < replyTries; i++) {
socket.send(packet); socket.send(packet);
if (!enabled) break; if (!enabled) break;
try { try {