tokudu / AndroidPushNotificationsDemo

A example of an android app that receives push notifications using MQTT.
http://tokudu.com/2010/how-to-implement-push-notifications-for-android
1.05k stars 509 forks source link

about keepAlive() function #4

Open THEONE10211024 opened 9 years ago

THEONE10211024 commented 9 years ago

In keepAlive() function in PushService line 292, as we can see: if "mConnection.sendKeepAlive();" this line throws a MqttException Exception and catched by the exception block, we will cancle both KEEP_ALIVE alarm and RECONNECT alarm.Thus we will lose connection with the server forever! And will not reconnect at some point in the future. What I'm worried is the CLIENT will completely lose connection with the SERVER forever? Am I right and how to figure out the problem?