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