Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[paho-dev] How to reconnect MqttAndroidClient in poor network conditions

Hello,
I use MqttAndroidClient in my app.I reconnect the mqtt(test.mosquitto.org) in the IMqttActionListener's OnFailure function.I  set cleanSession to false.I set timeout value 30 seconds.after the first timeout I add 10 seconds.The max value is 300 seconds.But it is hard to connect to the broker.Do you have some recommanded way to reconnect to the server.How to use MqttConnection.reconnect()?My code https://github.com/GisKook/gpstracker
 
2016-02-24

zhangkai.gis

Back to the top