From 19e86e3bc9ec863643036f3fdf3db65afbcac0f0 Mon Sep 17 00:00:00 2001 From: Boris Grozev Date: Thu, 15 Dec 2016 11:07:26 -0600 Subject: [PATCH] Revert "fix: Only allow setting the keep-alive strategy before the Agent is started." This reverts commit abec6b79e564961575b3372a2ead52053dd3a67e. --- src/main/java/org/ice4j/ice/Agent.java | 2 +- src/main/java/org/ice4j/ice/Component.java | 13 ++----------- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/src/main/java/org/ice4j/ice/Agent.java b/src/main/java/org/ice4j/ice/Agent.java index 37804fe..5da7f61 100644 --- a/src/main/java/org/ice4j/ice/Agent.java +++ b/src/main/java/org/ice4j/ice/Agent.java @@ -452,7 +452,7 @@ public class Agent IOException, BindException { - if (transport != Transport.UDP) + if(transport != Transport.UDP) { throw new IllegalArgumentException( "This implementation does not currently support transport: " diff --git a/src/main/java/org/ice4j/ice/Component.java b/src/main/java/org/ice4j/ice/Component.java index c48e9d8..1587ed3 100644 --- a/src/main/java/org/ice4j/ice/Component.java +++ b/src/main/java/org/ice4j/ice/Component.java @@ -1087,20 +1087,11 @@ public class Component /** * Sets the {@link KeepAliveStrategy} for this {@link Component}. - * @param strategy the strategy to set. The keep-alive strategy can only - * be modified before the parent {@link Agent} is started. - * @throws IllegalStateException if the agent has been started. + * @param strategy the strategy to set. */ public void setKeepAliveStrategy(KeepAliveStrategy strategy) { - IceProcessingState agentState - = getParentStream().getParentAgent().getState(); - if (!IceProcessingState.WAITING.equals(agentState)) - { - throw new IllegalStateException( - "Not changing the keep-alive strategy, the agent is is state " - + agentState); - } keepAliveStrategy = Objects.requireNonNull(strategy, "strategy"); } + }