Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [paho-dev] Disconnection issue on Android service

Hi,
 
The Android service only attempts to reconnect if the Android OS detects a network state change. For example switching from Cellular to WiFi or being in Aeroplane mode to connecting to WiFi will trigger an automatic reconnect. However if the Access point looses internet connectivity then the connection will time out and be lost permanently. This will trigger the connectionLost callback. You would be expected to use this to trigger a manual reconnect.
 
Automatic reconnect is something that has had quite a lot of interest in the last few weeks and it's on our to do list. But for the moment, the connectionLost callback will have to do I'm afraid.
 
Kind regards,
 
James Sutton
Software Engineer - IoT Foundation - MQTT Open Source Projects
Technical Trojan - Wimbledon Project

Phone: 01962 815438 | Extension: x372454
E-mail: 
Personal Website: www.jsutton.co.uk
Find me on:      
IBM

Hursley Park
HursleySO212JN
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: Kamaljeet <kamaljeetmaini@xxxxxxxxxxx>
Sent by: paho-dev-bounces@xxxxxxxxxxx
To: General development discussions for paho project <paho-dev@xxxxxxxxxxx>
Cc:
Subject: Re: [paho-dev] Disconnection issue on Android service
Date: Thu, Oct 15, 2015 7:20 PM
 
Thanks Rajitha for the feedback. For now, I have changed the keep alive to 1 minute. This may reduce the severity of the issue but won't fully resolve it.
 
I checked GCM's working and it also has similar limitation. If Internet connection breaks without any obvious sign on the device, GCM won't be able to receive 
any messages until it pings the server again, which can be as high as 15 minutes. 
 

Date: Thu, 15 Oct 2015 11:42:49 +0530
From: slamdamjc@xxxxxxxxx
To: paho-dev@xxxxxxxxxxx
Subject: Re: [paho-dev] Disconnection issue on Android service
 
Helllo Kamajeet,
 
I've been having the same issue. Until now I could only lower the keep alive interval as a solution. More than keeping the connection alive, keep alive ping seems to be worth as a connection verifier here.
I wish there was a way for the client to register a connection loss in case of a message delivery failure too.
 
Would like to hear the views of the others on this matter.
 
Cheers.
 
On 14 October 2015 at 22:44, Kamaljeet <kamaljeetmaini@xxxxxxxxxxx> wrote:
Hello,
I have run into a corner case issue while using Paho Android service. Here is the scenario:
 
1) Connect Android device to a Wi-Fi Access Point
2) Using Paho Android service, connect and subscribe to a topic
3) Verify that service can receive messages on the topic
4) Disconnect Internet cable from Wi-Fi router. There is no change in connection between Android and Wi-Fi AP.
5) Reconnect the Internet cable to the Wi-Fi router.
6) Send a message on the topic. The message is NOT received. This continues to happen until the next keepalive interval. 
 
It seems that when Wi-Fi AP loses Internet connection, this tears down the connection between service and broker but service is not notified of this by the Android system. This is because there is no change in Wi-Fi connectivity. Even when Wi-Fi AP connects back to Internet, the Android service has no connection to the broker. Only when the keepalive interval expires and service tries to communicate with the broker, it finds out that connection is broken and it tries to reestablish the connection.
 
Have you come access this scenario? Is there a potential solution or upcoming fix for this?
 
I have a keepalive of 10 minutes, so this causes missed MQTT messages for up to 10 minutes. 
 
Thanks,
Kamaljeet
 

_______________________________________________
paho-dev mailing list
paho-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/paho-dev

_______________________________________________ paho-dev mailing list paho-dev@xxxxxxxxxxx To change your delivery options, retrieve your password, or unsubscribe from this list, visit https://dev.eclipse.org/mailman/listinfo/paho-dev
_______________________________________________
paho-dev mailing list
paho-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/paho-dev
 


Back to the top