[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [paho-dev] How to reconnect MqttAndroidClient in poor network conditions
|
Hi,
The existing sample app should really be renamed to demo or something like that as it's actually a very complicated use of the Android service and isn't the best example for anyone starting out, sorry about that! Hopefully I'll get a chance to put a proper example in soon!
Kind regards,
James Sutton Software Engineer - IoT Foundation - MQTT Open Source Projects Technical Trojan - Wimbledon Project |
|
| Hursley Park Hursley, SO212JN United Kingdom |
IBM United Kingdom Limited Registered in England and Wales with number 741598 Registered office: PO Box 41, North Harbour, Portsmouth, Hants. PO6 3AU
----- Original message -----
From: "zhangkai.gis"<zhangkai.gis@xxxxxxx>
Sent by: paho-dev-bounces@xxxxxxxxxxx
To: "paho-dev"<paho-dev@xxxxxxxxxxx>
Cc:
Subject: [paho-dev] How to reconnect MqttAndroidClient in poor network conditions
Date: Wed, Feb 24, 2016 12:33 PM
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
Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU