1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-12-26 20:47:58 +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++)
try {
System.err.println(i);
Thread.sleep(300);
Thread.sleep(400);
}
catch (InterruptedException e) {
e.printStackTrace();

View file

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