From bd96816102b529b7c188e2067feefca837f436dd Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Thu, 3 Apr 2014 10:50:23 +0200 Subject: [PATCH] Add setter and javadoc for packet reply timeout --- .../org/jivesoftware/smack/XMPPConnection.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/core/src/main/java/org/jivesoftware/smack/XMPPConnection.java b/core/src/main/java/org/jivesoftware/smack/XMPPConnection.java index bc4846ea6..9b611d80f 100644 --- a/core/src/main/java/org/jivesoftware/smack/XMPPConnection.java +++ b/core/src/main/java/org/jivesoftware/smack/XMPPConnection.java @@ -41,6 +41,7 @@ import java.util.logging.Logger; import javax.security.sasl.SaslException; +import org.jivesoftware.smack.SmackException.NoResponseException; import org.jivesoftware.smack.SmackException.NotConnectedException; import org.jivesoftware.smack.SmackException.ConnectionException; import org.jivesoftware.smack.compression.XMPPInputOutputStream; @@ -931,10 +932,26 @@ public abstract class XMPPConnection { rosterVersioningSupported = true; } + /** + * Returns the current value of the reply timeout in milliseconds for request for this + * XMPPConnection instance. + * + * @return the packet reply timeout in milliseconds + */ public long getPacketReplyTimeout() { return packetReplyTimeout; } + /** + * Set the packet reply timeout in milliseconds. In most cases, Smack will throw a + * {@link NoResponseException} if no reply to a request was received within the timeout period. + * + * @param timeout the packet reply timeout in milliseconds + */ + public void setPacketReplyTimeout(long timeout) { + packetReplyTimeout = timeout; + } + /** * Processes a packet after it's been fully parsed by looping through the installed * packet collectors and listeners and letting them examine the packet to see if