1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-25 21:42:07 +01:00

Use connection specific reply timeout value

instead of the global default one.
This commit is contained in:
Florian Schmaus 2014-04-23 09:49:05 +02:00
parent 439f4cd291
commit 069e7d7e60
4 changed files with 5 additions and 10 deletions

View file

@ -187,7 +187,7 @@ public class XMPPBOSHConnection extends XMPPConnection {
synchronized (this) {
if (!connected) {
try {
wait(SmackConfiguration.getDefaultPacketReplyTimeout()*6);
wait(getPacketReplyTimeout());
}
catch (InterruptedException e) {}
}

View file

@ -489,7 +489,7 @@ public abstract class XMPPConnection {
if (!roster.rosterInitialized && config.isRosterLoadedAtLogin()) {
try {
synchronized (roster) {
long waitTime = SmackConfiguration.getDefaultPacketReplyTimeout();
long waitTime = getPacketReplyTimeout();
long start = System.currentTimeMillis();
while (!roster.rosterInitialized) {
if (waitTime <= 0) {

View file

@ -18,7 +18,6 @@
package org.jivesoftware.smackx.offline;
import org.jivesoftware.smack.PacketCollector;
import org.jivesoftware.smack.SmackConfiguration;
import org.jivesoftware.smack.SmackException.NoResponseException;
import org.jivesoftware.smack.SmackException.NotConnectedException;
import org.jivesoftware.smack.XMPPConnection;
@ -162,9 +161,7 @@ public class OfflineMessageManager {
Message message = (Message) messageCollector.nextResult();
while (message != null) {
messages.add(message);
message =
(Message) messageCollector.nextResult(
SmackConfiguration.getDefaultPacketReplyTimeout());
message = (Message) messageCollector.nextResult();
}
// Stop queuing offline messages
messageCollector.cancel();
@ -193,9 +190,7 @@ public class OfflineMessageManager {
Message message = (Message) messageCollector.nextResult();
while (message != null) {
messages.add(message);
message =
(Message) messageCollector.nextResult(
SmackConfiguration.getDefaultPacketReplyTimeout());
message = (Message) messageCollector.nextResult();
}
// Stop queuing offline messages
messageCollector.cancel();

View file

@ -793,7 +793,7 @@ public class XMPPTCPConnection extends XMPPConnection {
// Wait until compression is being used or a timeout happened
synchronized (this) {
try {
this.wait(SmackConfiguration.getDefaultPacketReplyTimeout() * 5);
wait(getPacketReplyTimeout());
}
catch (InterruptedException e) {
// Ignore.