Notify main loop when a connection failed.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 13 Jan 2015 19:55:08 +0000 (20:55 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Tue, 13 Jan 2015 19:55:08 +0000 (20:55 +0100)
src/main/java/net/pterodactylus/xdcc/core/Core.java

index f7b0595..c2eaae8 100644 (file)
@@ -571,6 +571,9 @@ public class Core extends AbstractExecutionThreadService {
        public void connectionClosed(ConnectionClosed connectionClosed) {
                connectionBackoff.connectionFailed(getNetwork(connectionClosed.connection()).get());
                removeConnection(connectionClosed.connection());
+               synchronized (syncObject) {
+                       syncObject.notifyAll();
+               }
                eventBus.post(new GenericMessage(String.format("Connection closed by %s.", connectionClosed.connection().hostname())));
        }
 
@@ -584,6 +587,9 @@ public class Core extends AbstractExecutionThreadService {
        public void connectionFailed(ConnectionFailed connectionFailed) {
                connectionBackoff.connectionFailed(getNetwork(connectionFailed.connection()).get());
                removeConnection(connectionFailed.connection());
+               synchronized (syncObject) {
+                       syncObject.notifyAll();
+               }
                eventBus.post(new GenericMessage(String.format("Could not connect to %s: %s.", connectionFailed.connection().hostname(), connectionFailed.cause())));
        }