public final class PingManager extends Manager
If enabled, it periodically pings the server to ensure a stable connection. These pings are not sent as long as other stanzas are sent, because they serve the same purpose (telling the server, that we are still available).
For Server-To-Client Pings it automatically responds with a result (pong), if enabled.
It also allows to ping the server manually (Client-To-Server Pings) or to ping other XMPP entities (Client-to-Client Pings).
| Modifier and Type | Method and Description |
|---|---|
Duration |
getPingInterval()
Gets the ping interval.
|
AsyncResult<Boolean> |
ping(rocks.xmpp.addr.Jid jid)
Pings the given XMPP entity.
|
AsyncResult<Boolean> |
pingServer()
Pings the connected server.
|
void |
setPingInterval(Duration pingInterval)
Sets the automatic ping interval.
|
void |
setPingInterval(long pingInterval)
Deprecated.
|
isEnabled, setEnabledpublic final AsyncResult<Boolean> ping(rocks.xmpp.addr.Jid jid)
jid - The JID to ping.public final AsyncResult<Boolean> pingServer()
@Deprecated public final void setPingInterval(long pingInterval)
setPingInterval(Duration)pingInterval - The ping interval in seconds.getPingInterval()public final Duration getPingInterval()
setPingInterval(long)public final void setPingInterval(Duration pingInterval)
pingInterval - The ping interval in seconds.getPingInterval()Copyright © 2014–2017 XMPP.rocks. All rights reserved.