java - Smack 4.1 Re-connection issue -


i developing chat application in which

  1. i have background service continuously running.
  2. the application running smoothly , able receive , send messages without issue.
  3. 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

  1. what use of pingmanager? can pingmanager helpful in case?
  2. what streammanagement? how can enable it? helpful in case?

any other solutions conquer problem? thinking of following solutions:

  1. to use gcm xmpp, when xmpp failed reconnect, can push , connect again on basis of push.
  2. use alarm services. (problem : messages in queue because of connection lost dependent on next alarm schedule)
  3. 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. page 1

page 2

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

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -