1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-06-13 15:14:54 +02:00

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.
This commit is contained in:
Florian Schmaus 2014-04-27 15:52:49 +02:00
parent 874a22489e
commit 854489e785

View file

@ -215,7 +215,7 @@ public abstract class XMPPConnection {
*/ */
private int port; private int port;
private Boolean bindingRequired; private boolean bindingRequired;
private boolean sessionSupported; private boolean sessionSupported;
/** /**
@ -452,10 +452,6 @@ public abstract class XMPPConnection {
*/ */
void serverRequiresBinding() { void serverRequiresBinding() {
bindingRequired = true; 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, String bindResourceAndEstablishSession(String resource) throws XMPPErrorException,
ResourceBindingNotOfferedException, NoResponseException, NotConnectedException { ResourceBindingNotOfferedException, NoResponseException, NotConnectedException {
synchronized (bindingRequired) {
if (!bindingRequired) {
try {
// Wait until server sends response containing the <bind> element
bindingRequired.wait(getPacketReplyTimeout());
}
catch (InterruptedException e) {
// Ignore
}
}
}
if (!bindingRequired) { if (!bindingRequired) {
// Server never offered resource binding, which is REQURIED in XMPP client and server // Server never offered resource binding, which is REQURIED in XMPP client and server