From f7de4be1f9be9eb9990971ddf80a9a18dd3ae353 Mon Sep 17 00:00:00 2001 From: Gaston Dombiak Date: Thu, 1 Jan 2004 23:21:49 +0000 Subject: [PATCH] The packet-reply-timeout is obtained from SmackConfiguration git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@2191 b35dd754-fafc-0310-a699-88a17e54d16e --- .../org/jivesoftware/smack/AccountManager.java | 18 ++++-------------- source/org/jivesoftware/smack/GroupChat.java | 12 +----------- .../org/jivesoftware/smack/XMPPConnection.java | 16 +++------------- 3 files changed, 8 insertions(+), 38 deletions(-) diff --git a/source/org/jivesoftware/smack/AccountManager.java b/source/org/jivesoftware/smack/AccountManager.java index 1e06a2bf0..5efdd87c6 100644 --- a/source/org/jivesoftware/smack/AccountManager.java +++ b/source/org/jivesoftware/smack/AccountManager.java @@ -67,16 +67,6 @@ import java.util.*; */ public class AccountManager { - /** - * Value that indicates the number of milliseconds to wait for a response from - * the server. - * - * The reply timeout value can be assigned by setting this field to the required - * timeout, or by modifying the smack.configuration file that holds the default value - * to use. - */ - public static int REPLY_TIMEOUT = 5000; - private XMPPConnection connection; private Registration info = null; @@ -217,7 +207,7 @@ public class AccountManager { new PacketTypeFilter(IQ.class)); PacketCollector collector = connection.createPacketCollector(filter); connection.sendPacket(reg); - IQ result = (IQ)collector.nextResult(REPLY_TIMEOUT); + IQ result = (IQ)collector.nextResult(SmackConfiguration.getPacketReplyTimeout()); if (result == null) { throw new XMPPException("No response from server."); } @@ -244,7 +234,7 @@ public class AccountManager { new PacketTypeFilter(IQ.class)); PacketCollector collector = connection.createPacketCollector(filter); connection.sendPacket(reg); - IQ result = (IQ)collector.nextResult(REPLY_TIMEOUT); + IQ result = (IQ)collector.nextResult(SmackConfiguration.getPacketReplyTimeout()); if (result == null) { throw new XMPPException("No response from server."); } @@ -276,7 +266,7 @@ public class AccountManager { new PacketTypeFilter(IQ.class)); PacketCollector collector = connection.createPacketCollector(filter); connection.sendPacket(reg); - IQ result = (IQ)collector.nextResult(REPLY_TIMEOUT); + IQ result = (IQ)collector.nextResult(SmackConfiguration.getPacketReplyTimeout()); if (result == null) { throw new XMPPException("No response from server."); } @@ -297,7 +287,7 @@ public class AccountManager { new PacketTypeFilter(IQ.class)); PacketCollector collector = connection.createPacketCollector(filter); connection.sendPacket(reg); - IQ result = (IQ)collector.nextResult(REPLY_TIMEOUT); + IQ result = (IQ)collector.nextResult(SmackConfiguration.getPacketReplyTimeout()); if (result == null) { throw new XMPPException("No response from server."); } diff --git a/source/org/jivesoftware/smack/GroupChat.java b/source/org/jivesoftware/smack/GroupChat.java index 0d19eaf17..a66828202 100644 --- a/source/org/jivesoftware/smack/GroupChat.java +++ b/source/org/jivesoftware/smack/GroupChat.java @@ -69,16 +69,6 @@ import java.util.*; */ public class GroupChat { - /** - * Value that indicates the number of milliseconds to wait for a response from - * the server. - * - * The reply timeout value can be assigned by setting this field to the required - * timeout, or by modifying the smack.configuration file that holds the default value - * to use. - */ - public static int REPLY_TIMEOUT = 5000; - private XMPPConnection connection; private String room; private String nickname = null; @@ -161,7 +151,7 @@ public class GroupChat { * nickname. */ public synchronized void join(String nickname) throws XMPPException { - join(nickname, REPLY_TIMEOUT); + join(nickname, SmackConfiguration.getPacketReplyTimeout()); } /** diff --git a/source/org/jivesoftware/smack/XMPPConnection.java b/source/org/jivesoftware/smack/XMPPConnection.java index e73d78365..ba2ff85f2 100644 --- a/source/org/jivesoftware/smack/XMPPConnection.java +++ b/source/org/jivesoftware/smack/XMPPConnection.java @@ -93,16 +93,6 @@ public class XMPPConnection { */ public static boolean DEBUG_ENABLED = false; - /** - * Value that indicates the number of milliseconds to wait for a response from - * the server. - * - * The reply timeout value can be assigned by setting this field to the required - * timeout, or by modifying the smack.configuration file that holds the default value - * to use. - */ - public static int REPLY_TIMEOUT = 5000; - private static List connectionEstablishedListeners = new ArrayList(); static { // Use try block since we may not have permission to get a system @@ -280,7 +270,7 @@ public class XMPPConnection { // Send the packet packetWriter.sendPacket(discoveryAuth); // Wait up to a certain number of seconds for a response from the server. - IQ response = (IQ) collector.nextResult(REPLY_TIMEOUT); + IQ response = (IQ) collector.nextResult(SmackConfiguration.getPacketReplyTimeout()); if (response == null) { throw new XMPPException("No response from the server."); } @@ -313,7 +303,7 @@ public class XMPPConnection { // Send the packet. packetWriter.sendPacket(auth); // Wait up to a certain number of seconds for a response from the server. - response = (IQ) collector.nextResult(REPLY_TIMEOUT); + response = (IQ) collector.nextResult(SmackConfiguration.getPacketReplyTimeout()); if (response == null) { throw new XMPPException("Authentication failed."); } @@ -377,7 +367,7 @@ public class XMPPConnection { // Send the packet. packetWriter.sendPacket(auth); // Wait up to a certain number of seconds for a response from the server. - IQ response = (IQ) collector.nextResult(REPLY_TIMEOUT); + IQ response = (IQ) collector.nextResult(SmackConfiguration.getPacketReplyTimeout()); if (response == null) { throw new XMPPException("Anonymous login failed."); }