From d304978b6d5732acf1947ab481e9f08d88f36e01 Mon Sep 17 00:00:00 2001 From: paweldomas Date: Wed, 18 Sep 2013 07:20:33 +0000 Subject: [PATCH] Applies Jakub Adamek patch that adds NO_KEEP_ALIVES property which can be used to disable STUN keep alives. --- src/org/ice4j/StackProperties.java | 6 ++++++ src/org/ice4j/ice/Agent.java | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/org/ice4j/StackProperties.java b/src/org/ice4j/StackProperties.java index 6b2627c..8fcb8cf 100644 --- a/src/org/ice4j/StackProperties.java +++ b/src/org/ice4j/StackProperties.java @@ -113,6 +113,12 @@ public class StackProperties public static final String TERMINATION_DELAY = "org.ice4j.TERMINATION_DELAY"; + /** + * The name of the property that can be used to disable STUN keep alives. + * Set to true to disable. + */ + public static final String NO_KEEP_ALIVES = "org.ice4j.NO_KEEP_ALIVES"; + /** * THIS PROPERTY IS CURRENTLY UNUSED. IF YOU WANT TO SPEED UP NOMINATIONS * THEN CONSIDER SPEEDING UP TRANSACTION FAILURE FOR THE TIME BEING. diff --git a/src/org/ice4j/ice/Agent.java b/src/org/ice4j/ice/Agent.java index 1dd6641..e3de195 100644 --- a/src/org/ice4j/ice/Agent.java +++ b/src/org/ice4j/ice/Agent.java @@ -1739,7 +1739,9 @@ public class Agent setState(IceProcessingState.COMPLETED); // keep ICE running (answer binding request) - if(stunKeepAliveThread == null) + if(stunKeepAliveThread == null + && ! StackProperties.getBoolean( + StackProperties.NO_KEEP_ALIVES, false)) { // schedule STUN checks for selected candidates scheduleSTUNKeepAlive();