Fix PingManager.ping(String,long)

ignoring timeout. SMACK-609
This commit is contained in:
Florian Schmaus 2014-09-29 13:52:13 +02:00
parent aea58e0735
commit 039fac7ab7
1 changed files with 2 additions and 2 deletions

View File

@ -164,7 +164,7 @@ public class PingManager extends Manager {
* by the entity.
*
* @param jid The id of the entity the ping is being sent to
* @param pingTimeout The time to wait for a reply
* @param pingTimeout The time to wait for a reply in milliseconds
* @return true if a reply was received from the entity, false otherwise.
* @throws NoResponseException if there was no response from the jid.
* @throws NotConnectedException
@ -172,7 +172,7 @@ public class PingManager extends Manager {
public boolean ping(String jid, long pingTimeout) throws NotConnectedException, NoResponseException {
Ping ping = new Ping(jid);
try {
connection().createPacketCollectorAndSend(ping).nextResultOrThrow();
connection().createPacketCollectorAndSend(ping).nextResultOrThrow(pingTimeout);
}
catch (XMPPException exc) {
return jid.equals(connection().getServiceName());