keepalive ? OpenFire default six minute idle disconnect ...

1,477 views
Skip to first unread message

Jesse Reynolds

unread,
Aug 14, 2012, 7:53:52 PM8/14/12
to xmpp-b...@googlegroups.com
Hello, 

I'm wondering how people generally handle connections to XMPP servers that disconnect idle clients. 

I'm writing an XMPP gateway that talks to an Openfire server, which has default behaviour of disconnecting idle clients after six minutes of idle. Pidgen added sending of a whitespace only message every minute - http://developer.pidgin.im/viewmtn/revision/info/9aace88a3b513de8c7b7189fef9bf112258412b5

I can see this is in the blather code but commented out on lines 157 and 200 of stream.rb:

157 #      @keepalive = EM::PeriodicTimer.new(60) { send_data ' ' }                                                  

...

200 #      @keepalive.cancel                                                                                         

Does this issue not affect anyone else? Would it be worth adding a handler in the DSL to set up keepalive handling? ... I guess for now I can set up an EM.add_periodic_timer(60) to send some whitespace to the server. 

Thank you
Jesse

BRIAN BEGGS

unread,
Aug 14, 2012, 8:58:28 PM8/14/12
to xmpp-b...@googlegroups.com
First no matter what solution you pursue I would suggest increasing this timeout on the server side if you can.

Our clients have implemented XEP-0199 (xmpp ping) to keep connections open.  The send white space method will work but it felt hackish to us, though your mileage may vary.

It would be great if some of the communities around these servers and clients would start implementing XEP-0198 but support is still spotty.

Brian

--
You received this message because you are subscribed to the Google Groups "Blather" group.
To view this discussion on the web visit https://groups.google.com/d/msg/xmpp-blather/-/M5snUAYUha4J.
To post to this group, send email to xmpp-b...@googlegroups.com.
To unsubscribe from this group, send email to xmpp-blather...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/xmpp-blather?hl=en.

Jesse Reynolds

unread,
Aug 16, 2012, 10:28:37 PM8/16/12
to xmpp-b...@googlegroups.com
Thanks Brian

Do you know if XEP-0198 pings will work with Openfire? The whitespace method is working for me for now. 

Cheers
Jesse

Ben Langfeld

unread,
Aug 15, 2012, 7:00:33 AM8/15/12
to xmpp-b...@googlegroups.com
Indeed XEP-0199 is a good solution. It's also not difficult to implement: https://github.com/adhearsion/punchblock/blob/develop/lib/punchblock/connection/xmpp.rb#L162

Perhaps we should include something in the DSL for this.

Regards,
Ben Langfeld
Reply all
Reply to author
Forward
0 new messages