public final class PingManager extends ExtensionManager
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 |
|---|---|
long |
getPingInterval()
Gets the ping interval in seconds.
|
boolean |
ping(Jid jid)
Pings the given XMPP entity.
|
boolean |
ping(Jid jid,
long timeout)
Pings the given XMPP entity.
|
boolean |
pingServer()
Pings the connected server.
|
void |
setEnabled(boolean enabled)
Enables or disables support for the extension.
|
void |
setPingInterval(long pingInterval)
Sets the automatic ping interval in seconds.
|
isEnabledpublic final boolean ping(Jid jid)
jid - The JID to ping.public final boolean ping(Jid jid, long timeout)
jid - The JID to ping.timeout - The timeout in milliseconds.public final boolean pingServer()
public final long getPingInterval()
setPingInterval(long)public final void setPingInterval(long pingInterval)
pingInterval - The ping interval in seconds.getPingInterval()public final void setEnabled(boolean enabled)
ExtensionManagersetEnabled in class ExtensionManagerenabled - True, if support for the managed extension should be enabled; otherwise false.ExtensionManager.isEnabled()Copyright © 2014–2015 XMPP.rocks. All rights reserved.