I have ejabberd setup to be the xmpp server between mobile apps, ie. custom iPhone and Android app.But I've seemingly run into a limitation of the way ejabberd handles online status. Assume there are two users A & B friends to each other and having current live chat conversation. Suppose one of them loss his internet connection then there is no way to instantly update his status to server. So his status remains online. One solution to this problem is using mod_ping module in xmpp. But it's also have certain limitation, it will ping every clients after 32 seconds interval. So there is always 30 to 40 seconds delay in status update of user. I want to update any user's status instantly (less than 10 seconds) in good network condition like what's up. This is very first scenario of chat app everyone face and i hope someone will help me through this.
4
votes
Mod ping doesn't have delay of 32 seconds. Infact in smack I am using a timeout of 10s-15s and if no response received then I am declaring the offline. How did you came up with number 32 seconds?
– user2223032
hi thanks for comments , i'm personaly feel it while developement and all documents i refered on this also says the same . You can check it here process-one.net/docs/ejabberd/guide_en.html#modping
– RamjanSayyad
No this is server to client ping. In this case the server wait for 32s before declaring client offline. Then a presence will be broadcasted. Mind it that there are resume_time/max_resume_time (both default to 5 minutes) are also there so total delay will be 5min+32sec when you don't disconnect manually. Client to client ping is what you should try - igniterealtime.org/builds/smack/docs/4.1.4/javadoc/org/… .
– user2223032
i didn't understand mod_ping and resume_time/max_resume_time behaviour clearly, i will take detail look on it's each functions, but is it help to resolved my problem?
– RamjanSayyad
Right if you want to make you app based on presence then it's impossible without draining user battery. Better idea is to use client to client ping but it is more of like a polling and not actual push.
– user2223032
1 Answers
2
votes
In ejabberd upcoming 15.12 version you have a new mod_ping
option: ping_ack_timeout
. You can put whatever timeout you want.
This is already available in master branch, so you can already use it if you want: https://github.com/processone/ejabberd