mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-09 09:09:38 +02:00
Rename waitForCondition() to waitForConditionOrConnectionException()
To make it clear that this will either return if the condition is true *or* if a connection exception happened. Also introduce waitFor(), which is deliberately not named waitForCondition() because it carries a different semantic.
This commit is contained in:
parent
f9292a23fb
commit
ddc39030d7
2 changed files with 12 additions and 8 deletions
|
@ -394,7 +394,7 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
|
|||
if (isSmResumptionPossible()) {
|
||||
smResumedSyncPoint = SyncPointState.request_sent;
|
||||
sendNonza(new Resume(clientHandledStanzasCount, smSessionId));
|
||||
waitForCondition(() -> smResumedSyncPoint == SyncPointState.successful || smResumptionFailed != null, "resume previous stream");
|
||||
waitForConditionOrConnectionException(() -> smResumedSyncPoint == SyncPointState.successful || smResumptionFailed != null, "resume previous stream");
|
||||
if (smResumedSyncPoint == SyncPointState.successful) {
|
||||
// We successfully resumed the stream, be done here
|
||||
afterSuccessfulLogin(true);
|
||||
|
@ -518,7 +518,7 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
|
|||
setWasAuthenticated();
|
||||
|
||||
try {
|
||||
boolean readerAndWriterThreadsTermianted = waitForCondition(() -> !packetWriter.running && !packetReader.running);
|
||||
boolean readerAndWriterThreadsTermianted = waitForConditionOrConnectionException(() -> !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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue