From b6341e3bc7a87371e9b4f1734fccda3a2959bed2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Tue, 13 Jan 2015 20:55:08 +0100 Subject: [PATCH] Notify main loop when a connection failed. --- src/main/java/net/pterodactylus/xdcc/core/Core.java | 6 ++++++ 1 file changed, 6 insertions(+) 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()))); } -- 2.7.4