java - Smack 4.1 Re-connection issue -
i developing chat application in which
- i have background service continuously running.
- the application running smoothly , able receive , send messages without issue.
- i using default smack 4.1 re-connection manager, connecting connection lost (almost 90% of time).
but sometimes, when connection lost, smack re-connection manager stops working.
i have not been able find out causing issue.
when check phone, after delay of 12 14 hours, can see android service still running, xmpp re-connection has stopped working. must force-stop application in order restart service , have connect xmpp server again.
my assumption is happening when "phone network switches wifi-to-data or data-to-wifi". in meantime, smack 4.1 re-connection manager stops working. although, not sure it.
and have questions
- what use of pingmanager? can pingmanager helpful in case?
- what streammanagement? how can enable it? helpful in case?
any other solutions conquer problem? thinking of following solutions:
- to use gcm xmpp, when xmpp failed reconnect, can push , connect again on basis of push.
- use alarm services. (problem : messages in queue because of connection lost dependent on next alarm schedule)
- every time connect xmpp when user returns application. (problem : messages in queue because of connection lost dependent on user returning app)
a little late maybe helps others. not xmpp expert came across presentation of ignite realtime called "xmpp , android" , points out issue , how handle this.
it offers using server ping alarm manager ideally 30 min intervals.
also found post related issue , offers 3 option. worths see. https://ramzandroidarchive.wordpress.com/2016/03/14/handling-connection-break-issue-in-smack-4-1/.
Comments
Post a Comment