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();