From: David ‘Bombe’ Roden Date: Tue, 13 Jan 2015 19:55:08 +0000 (+0100) Subject: Notify main loop when a connection failed. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=b6341e3bc7a87371e9b4f1734fccda3a2959bed2;p=xudocci.git Notify main loop when a connection failed. --- diff --git a/src/main/java/net/pterodactylus/xdcc/core/Core.java b/src/main/java/net/pterodactylus/xdcc/core/Core.java index f7b0595..c2eaae8 100644 --- a/src/main/java/net/pterodactylus/xdcc/core/Core.java +++ b/src/main/java/net/pterodactylus/xdcc/core/Core.java @@ -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()))); }