hedwig-im / hedwig_xmpp

XMPP Adapter for Hedwig
MIT License
12 stars 6 forks source link

add server ping every 120s for connection keepalive #5

Open themgt opened 7 years ago

themgt commented 7 years ago

I ported this code from https://github.com/jwarlander/hedwig_hipchat/blob/1f9213b8b19466da2b0741a616da3399a79af47b/lib/hedwig_hipchat.ex

not sure if it should be enabled for everyone, but was necessary in our case to avoid disconnect/reconnect every every 5 min (believe the server is openfire)

bossyang commented 6 years ago

My situation is even worse. The hedwig bot disconnect/reconnect every 1 min.

Openfire 4.1.5

from Spark chat window:

*** JBOT went offline at 9:00 PM
*** JBOT is online at 9:00 PM
*** JBOT went offline at 9:01 PM
*** JBOT is online at 9:01 PM
*** JBOT went offline at 9:02 PM
*** JBOT is online at 9:02 PM
*** JBOT went offline at 9:03 PM
*** JBOT is online at 9:03 PM