mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-10 01:29:38 +02:00
Allows reply timeout to be set
git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@2189 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
129f0a0bd2
commit
41dad8658a
6 changed files with 139 additions and 32 deletions
|
@ -67,6 +67,16 @@ 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;
|
||||
|
||||
|
@ -207,7 +217,7 @@ public class AccountManager {
|
|||
new PacketTypeFilter(IQ.class));
|
||||
PacketCollector collector = connection.createPacketCollector(filter);
|
||||
connection.sendPacket(reg);
|
||||
IQ result = (IQ)collector.nextResult(5000);
|
||||
IQ result = (IQ)collector.nextResult(REPLY_TIMEOUT);
|
||||
if (result == null) {
|
||||
throw new XMPPException("No response from server.");
|
||||
}
|
||||
|
@ -234,7 +244,7 @@ public class AccountManager {
|
|||
new PacketTypeFilter(IQ.class));
|
||||
PacketCollector collector = connection.createPacketCollector(filter);
|
||||
connection.sendPacket(reg);
|
||||
IQ result = (IQ)collector.nextResult(5000);
|
||||
IQ result = (IQ)collector.nextResult(REPLY_TIMEOUT);
|
||||
if (result == null) {
|
||||
throw new XMPPException("No response from server.");
|
||||
}
|
||||
|
@ -266,7 +276,7 @@ public class AccountManager {
|
|||
new PacketTypeFilter(IQ.class));
|
||||
PacketCollector collector = connection.createPacketCollector(filter);
|
||||
connection.sendPacket(reg);
|
||||
IQ result = (IQ)collector.nextResult(5000);
|
||||
IQ result = (IQ)collector.nextResult(REPLY_TIMEOUT);
|
||||
if (result == null) {
|
||||
throw new XMPPException("No response from server.");
|
||||
}
|
||||
|
@ -287,7 +297,7 @@ public class AccountManager {
|
|||
new PacketTypeFilter(IQ.class));
|
||||
PacketCollector collector = connection.createPacketCollector(filter);
|
||||
connection.sendPacket(reg);
|
||||
IQ result = (IQ)collector.nextResult(5000);
|
||||
IQ result = (IQ)collector.nextResult(REPLY_TIMEOUT);
|
||||
if (result == null) {
|
||||
throw new XMPPException("No response from server.");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue