summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2013-06-11 00:03:48 +0200
committermathieui <mathieui@mathieui.net>2013-06-11 00:03:48 +0200
commit2b4c06b6f81f46e9f712882877fdd261aae84065 (patch)
tree812f285b1b0fd638f19032a00040f60ce12a006c /src
parent97d3690aea8926f50eed2d5d0194114228c1e3ef (diff)
downloadpoezio-2b4c06b6f81f46e9f712882877fdd261aae84065.tar.gz
poezio-2b4c06b6f81f46e9f712882877fdd261aae84065.tar.bz2
poezio-2b4c06b6f81f46e9f712882877fdd261aae84065.tar.xz
poezio-2b4c06b6f81f46e9f712882877fdd261aae84065.zip
Fix #2315 (send pings to the server every minute to check the connection)
add two new options: connection_timeout_delay and connection_check_interval
Diffstat (limited to 'src')
-rw-r--r--src/connection.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/connection.py b/src/connection.py
index 91b6c1b9..0db7acad 100644
--- a/src/connection.py
+++ b/src/connection.py
@@ -72,6 +72,13 @@ class Connection(sleekxmpp.ClientXMPP):
self.register_plugin('xep_0085')
self.register_plugin('xep_0115')
self.register_plugin('xep_0191')
+ ping_interval = config.get('connection_check_interval', 60)
+ if ping_interval <= 0:
+ ping_interval = 60
+ timeout_delay = config.get('connection_timeout_delay', 10)
+ if timeout_delay <= 0:
+ timeout_delay = 10
+ self.register_plugin('xep_0199', pconfig={'keepalive': True, 'interval': ping_interval, 'timeout': timeout_delay})
if config.get('enable_user_tune', 'true') != 'false':
self.register_plugin('xep_0118')