1
0
Fork 0
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:
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) { synchronized (this) {
if (!connected) { if (!connected) {
try { try {
wait(SmackConfiguration.getDefaultPacketReplyTimeout()*6); wait(getPacketReplyTimeout());
} }
catch (InterruptedException e) {} catch (InterruptedException e) {}
} }

View file

@ -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) {

View file

@ -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();

View file

@ -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.