diff --git a/src/dorkbox/network/connection/EndPoint.java b/src/dorkbox/network/connection/EndPoint.java index b101f0ea..e03cfbc6 100644 --- a/src/dorkbox/network/connection/EndPoint.java +++ b/src/dorkbox/network/connection/EndPoint.java @@ -79,6 +79,7 @@ class EndPoint { protected final Class type; protected final Object shutdownInProgress = new Object(); + private volatile boolean isShutdown = false; // the eventLoop groups are used to track and manage the event loops for startup/shutdown private final List eventLoopGroups = new ArrayList(8); @@ -320,6 +321,8 @@ class EndPoint { // we also want to stop the thread group threadGroup.interrupt(); + + isShutdown = true; } // tell the blocked "bind" method that it may continue (and exit) @@ -339,6 +342,16 @@ class EndPoint { } } + /** + * @return true if we have already shutdown, false otherwise + */ + public final + boolean isShutdown() { + synchronized (shutdownInProgress) { + return isShutdown; + } + } + @Override public String toString() {