From a05b46403225059efbc4d2f17a806058a8509e6d Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Wed, 17 Jun 2020 20:29:21 +0200 Subject: [PATCH] Do not use waitForConditionOrConnectionException() in XMPPTCPConnection Since at this point, there will potentially be an active connection exception, which would cause the call to return immediately. --- .../main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java b/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java index 91bedc8e4..669130420 100644 --- a/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java +++ b/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java @@ -518,7 +518,7 @@ public class XMPPTCPConnection extends AbstractXMPPConnection { setWasAuthenticated(); try { - boolean readerAndWriterThreadsTermianted = waitForConditionOrConnectionException(() -> !packetWriter.running && !packetReader.running); + boolean readerAndWriterThreadsTermianted = waitFor(() -> !packetWriter.running && !packetReader.running); if (!readerAndWriterThreadsTermianted) { LOGGER.severe("Reader and/or writer threads did not terminate timely. Writer running: " + packetWriter.running + ", Reader running: " + packetReader.running);