From 854489e785dcd3127c73ee89db5966473d5adb8d Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Sun, 27 Apr 2014 15:52:49 +0200 Subject: [PATCH] No need to synchronize bindingRequired If binding is required or not is told the client by the server within the features stanzas. Smacks guarantees that connect() blocks until the features stanzas has been received and processed. --- .../org/jivesoftware/smack/XMPPConnection.java | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/core/src/main/java/org/jivesoftware/smack/XMPPConnection.java b/core/src/main/java/org/jivesoftware/smack/XMPPConnection.java index 18bca1197..a66cfaccc 100644 --- a/core/src/main/java/org/jivesoftware/smack/XMPPConnection.java +++ b/core/src/main/java/org/jivesoftware/smack/XMPPConnection.java @@ -215,7 +215,7 @@ public abstract class XMPPConnection { */ private int port; - private Boolean bindingRequired; + private boolean bindingRequired; private boolean sessionSupported; /** @@ -452,10 +452,6 @@ public abstract class XMPPConnection { */ void serverRequiresBinding() { bindingRequired = true; - // Wake up the thread that is waiting - synchronized(bindingRequired) { - bindingRequired.notify(); - } } /** @@ -469,17 +465,6 @@ public abstract class XMPPConnection { String bindResourceAndEstablishSession(String resource) throws XMPPErrorException, ResourceBindingNotOfferedException, NoResponseException, NotConnectedException { - synchronized (bindingRequired) { - if (!bindingRequired) { - try { - // Wait until server sends response containing the element - bindingRequired.wait(getPacketReplyTimeout()); - } - catch (InterruptedException e) { - // Ignore - } - } - } if (!bindingRequired) { // Server never offered resource binding, which is REQURIED in XMPP client and server