mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-10 17:49:38 +02:00
SMACK-388
Use ScheduledExecutorService. Set ping received when pinging another entity. Refactored PacketListener and ConnectionListeners as anonymous inner-classes git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@13531 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
c6248ec000
commit
5c6f257027
4 changed files with 153 additions and 176 deletions
|
@ -58,7 +58,10 @@ public final class SmackConfiguration {
|
|||
private static int localSocks5ProxyPort = 7777;
|
||||
private static int packetCollectorSize = 5000;
|
||||
|
||||
private static int defaultPingInterval = 1800000; // 30 min (30*60*1000)
|
||||
/**
|
||||
* defaultPingInterval (in seconds)
|
||||
*/
|
||||
private static int defaultPingInterval = 1800; // 30 min (30*60)
|
||||
|
||||
private SmackConfiguration() {
|
||||
}
|
||||
|
@ -109,7 +112,7 @@ public final class SmackConfiguration {
|
|||
else if (parser.getName().equals("packetCollectorSize")) {
|
||||
packetCollectorSize = parseIntProperty(parser, packetCollectorSize);
|
||||
}
|
||||
else if (parser.getName().equals("defaultPingInterval")) {
|
||||
else if (parser.getName().equals("defaultPingInterval")) {
|
||||
defaultPingInterval = parseIntProperty(parser, defaultPingInterval);
|
||||
}
|
||||
}
|
||||
|
@ -308,10 +311,20 @@ public final class SmackConfiguration {
|
|||
SmackConfiguration.localSocks5ProxyPort = localSocks5ProxyPort;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the default ping interval (seconds)
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static int getDefaultPingInterval() {
|
||||
return defaultPingInterval;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the default ping interval (seconds). Set it to '-1' to disable the periodic ping
|
||||
*
|
||||
* @param defaultPingInterval
|
||||
*/
|
||||
public static void setDefaultPingInterval(int defaultPingInterval) {
|
||||
SmackConfiguration.defaultPingInterval = defaultPingInterval;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue