summaryrefslogtreecommitdiff
path: root/java-compat/src/Ice/src/main/java/IceInternal/IncomingConnectionFactory.java
diff options
context:
space:
mode:
Diffstat (limited to 'java-compat/src/Ice/src/main/java/IceInternal/IncomingConnectionFactory.java')
-rw-r--r--java-compat/src/Ice/src/main/java/IceInternal/IncomingConnectionFactory.java33
1 files changed, 15 insertions, 18 deletions
diff --git a/java-compat/src/Ice/src/main/java/IceInternal/IncomingConnectionFactory.java b/java-compat/src/Ice/src/main/java/IceInternal/IncomingConnectionFactory.java
index 6c041f0a76b..b73eaa3c251 100644
--- a/java-compat/src/Ice/src/main/java/IceInternal/IncomingConnectionFactory.java
+++ b/java-compat/src/Ice/src/main/java/IceInternal/IncomingConnectionFactory.java
@@ -386,13 +386,14 @@ public final class IncomingConnectionFactory extends EventHandler implements Ice
}, 1, java.util.concurrent.TimeUnit.SECONDS);
return;
}
-
- assert(_state == StateClosed);
- setState(StateFinished);
-
- if(_acceptorStarted && close)
+ else if(_state == StateClosed)
{
- closeAcceptor();
+ setState(StateFinished);
+
+ if(_acceptorStarted && close)
+ {
+ closeAcceptor();
+ }
}
}
@@ -629,23 +630,19 @@ public final class IncomingConnectionFactory extends EventHandler implements Ice
case StateClosed:
{
- if(_acceptorStarted)
+ //
+ // If possible, close the acceptor now to prevent new connections from
+ // being accepted while we are deactivating. This is especially useful
+ // if there are no more threads in the thread pool available to dispatch
+ // the finish() call.
+ //
+ if(_adapter.getThreadPool().finish(this, true))
{
- //
- // If possible, close the acceptor now to prevent new connections from
- // being accepted while we are deactivating. This is especially useful
- // if there are no more threads in the thread pool available to dispatch
- // the finish() call.
- //
- if(_adapter.getThreadPool().finish(this, true))
+ if(_acceptorStarted)
{
closeAcceptor();
}
}
- else
- {
- state = StateFinished;
- }
for(Ice.ConnectionI connection : _connections)
{