mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-26 00:02:06 +01:00
Fix PingManager.ping(String,long)
ignoring timeout. SMACK-609
This commit is contained in:
parent
aea58e0735
commit
039fac7ab7
1 changed files with 2 additions and 2 deletions
|
@ -164,7 +164,7 @@ public class PingManager extends Manager {
|
||||||
* by the entity.
|
* by the entity.
|
||||||
*
|
*
|
||||||
* @param jid The id of the entity the ping is being sent to
|
* @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.
|
* @return true if a reply was received from the entity, false otherwise.
|
||||||
* @throws NoResponseException if there was no response from the jid.
|
* @throws NoResponseException if there was no response from the jid.
|
||||||
* @throws NotConnectedException
|
* @throws NotConnectedException
|
||||||
|
@ -172,7 +172,7 @@ public class PingManager extends Manager {
|
||||||
public boolean ping(String jid, long pingTimeout) throws NotConnectedException, NoResponseException {
|
public boolean ping(String jid, long pingTimeout) throws NotConnectedException, NoResponseException {
|
||||||
Ping ping = new Ping(jid);
|
Ping ping = new Ping(jid);
|
||||||
try {
|
try {
|
||||||
connection().createPacketCollectorAndSend(ping).nextResultOrThrow();
|
connection().createPacketCollectorAndSend(ping).nextResultOrThrow(pingTimeout);
|
||||||
}
|
}
|
||||||
catch (XMPPException exc) {
|
catch (XMPPException exc) {
|
||||||
return jid.equals(connection().getServiceName());
|
return jid.equals(connection().getServiceName());
|
||||||
|
|
Loading…
Reference in a new issue