diff options
-rw-r--r-- | src/javax/jmdns/impl/constants/DNSConstants.java | 4 | ||||
-rw-r--r-- | src/javax/jmdns/impl/tasks/state/Renewer.java | 5 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/javax/jmdns/impl/constants/DNSConstants.java b/src/javax/jmdns/impl/constants/DNSConstants.java index b79400b..2704f94 100644 --- a/src/javax/jmdns/impl/constants/DNSConstants.java +++ b/src/javax/jmdns/impl/constants/DNSConstants.java @@ -18,8 +18,8 @@ public final class DNSConstants { public static final int MDNS_PORT = Integer.parseInt(System.getProperty("net.mdns.port", "5353")); public static final int DNS_PORT = 53; - // DNS Records Expiration Time in Seconds - public static final int DNS_TTL = 25; + // One hour expiration time + public static final int DNS_TTL = 60 * 60; public static final int MAX_MSG_TYPICAL = 1460; public static final int MAX_MSG_ABSOLUTE = 8972; diff --git a/src/javax/jmdns/impl/tasks/state/Renewer.java b/src/javax/jmdns/impl/tasks/state/Renewer.java index 1c638d4..f79ee12 100644 --- a/src/javax/jmdns/impl/tasks/state/Renewer.java +++ b/src/javax/jmdns/impl/tasks/state/Renewer.java @@ -54,7 +54,10 @@ public class Renewer extends DNSStateTask { @Override public void start(Timer timer) { if (!this.getDns().isCanceling() && !this.getDns().isCanceled()) { - timer.schedule(this, DNSConstants.ANNOUNCED_RENEWAL_TTL_INTERVAL, DNSConstants.ANNOUNCED_RENEWAL_TTL_INTERVAL); + // BEGIN android-changed + // Schedule the renewer based on this task's TTL, not the default TTL + timer.schedule(this, getTTL() * 500, getTTL() * 500); + // END android-changed } } |