1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-12-22 10:37:59 +01:00

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

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());