mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-29 07:22:07 +01:00
Use connection specific reply timeout value
instead of the global default one.
This commit is contained in:
parent
439f4cd291
commit
069e7d7e60
4 changed files with 5 additions and 10 deletions
|
@ -187,7 +187,7 @@ public class XMPPBOSHConnection extends XMPPConnection {
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
if (!connected) {
|
if (!connected) {
|
||||||
try {
|
try {
|
||||||
wait(SmackConfiguration.getDefaultPacketReplyTimeout()*6);
|
wait(getPacketReplyTimeout());
|
||||||
}
|
}
|
||||||
catch (InterruptedException e) {}
|
catch (InterruptedException e) {}
|
||||||
}
|
}
|
||||||
|
|
|
@ -489,7 +489,7 @@ public abstract class XMPPConnection {
|
||||||
if (!roster.rosterInitialized && config.isRosterLoadedAtLogin()) {
|
if (!roster.rosterInitialized && config.isRosterLoadedAtLogin()) {
|
||||||
try {
|
try {
|
||||||
synchronized (roster) {
|
synchronized (roster) {
|
||||||
long waitTime = SmackConfiguration.getDefaultPacketReplyTimeout();
|
long waitTime = getPacketReplyTimeout();
|
||||||
long start = System.currentTimeMillis();
|
long start = System.currentTimeMillis();
|
||||||
while (!roster.rosterInitialized) {
|
while (!roster.rosterInitialized) {
|
||||||
if (waitTime <= 0) {
|
if (waitTime <= 0) {
|
||||||
|
|
|
@ -18,7 +18,6 @@
|
||||||
package org.jivesoftware.smackx.offline;
|
package org.jivesoftware.smackx.offline;
|
||||||
|
|
||||||
import org.jivesoftware.smack.PacketCollector;
|
import org.jivesoftware.smack.PacketCollector;
|
||||||
import org.jivesoftware.smack.SmackConfiguration;
|
|
||||||
import org.jivesoftware.smack.SmackException.NoResponseException;
|
import org.jivesoftware.smack.SmackException.NoResponseException;
|
||||||
import org.jivesoftware.smack.SmackException.NotConnectedException;
|
import org.jivesoftware.smack.SmackException.NotConnectedException;
|
||||||
import org.jivesoftware.smack.XMPPConnection;
|
import org.jivesoftware.smack.XMPPConnection;
|
||||||
|
@ -162,9 +161,7 @@ public class OfflineMessageManager {
|
||||||
Message message = (Message) messageCollector.nextResult();
|
Message message = (Message) messageCollector.nextResult();
|
||||||
while (message != null) {
|
while (message != null) {
|
||||||
messages.add(message);
|
messages.add(message);
|
||||||
message =
|
message = (Message) messageCollector.nextResult();
|
||||||
(Message) messageCollector.nextResult(
|
|
||||||
SmackConfiguration.getDefaultPacketReplyTimeout());
|
|
||||||
}
|
}
|
||||||
// Stop queuing offline messages
|
// Stop queuing offline messages
|
||||||
messageCollector.cancel();
|
messageCollector.cancel();
|
||||||
|
@ -193,9 +190,7 @@ public class OfflineMessageManager {
|
||||||
Message message = (Message) messageCollector.nextResult();
|
Message message = (Message) messageCollector.nextResult();
|
||||||
while (message != null) {
|
while (message != null) {
|
||||||
messages.add(message);
|
messages.add(message);
|
||||||
message =
|
message = (Message) messageCollector.nextResult();
|
||||||
(Message) messageCollector.nextResult(
|
|
||||||
SmackConfiguration.getDefaultPacketReplyTimeout());
|
|
||||||
}
|
}
|
||||||
// Stop queuing offline messages
|
// Stop queuing offline messages
|
||||||
messageCollector.cancel();
|
messageCollector.cancel();
|
||||||
|
|
|
@ -793,7 +793,7 @@ public class XMPPTCPConnection extends XMPPConnection {
|
||||||
// Wait until compression is being used or a timeout happened
|
// Wait until compression is being used or a timeout happened
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
try {
|
try {
|
||||||
this.wait(SmackConfiguration.getDefaultPacketReplyTimeout() * 5);
|
wait(getPacketReplyTimeout());
|
||||||
}
|
}
|
||||||
catch (InterruptedException e) {
|
catch (InterruptedException e) {
|
||||||
// Ignore.
|
// Ignore.
|
||||||
|
|
Loading…
Reference in a new issue