Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [paho-dev] Repeated calls callbackToActivity in MqttConnection

Hi Jacarri,

do you really mean 1000 lines of code should be deleted?

Ian

On 12/18/2014 07:30 AM, 陈健 wrote:
The first 1000 lines of MqttConnection's code should be deleted,because the "doAfterConnectFail(resultBundle)" already call "service.callbackToActivity".
-------------------------------------------------------------------
@Override
public void onFailure(IMqttToken asyncActionToken, Throwable exception) {
resultBundle.putString(
MqttServiceConstants.CALLBACK_ERROR_MESSAGE,
exception.getLocalizedMessage());
resultBundle.putSerializable(
MqttServiceConstants.CALLBACK_EXCEPTION,
exception);
service.callbackToActivity(clientHandle, Status.ERROR,
resultBundle);

doAfterConnectFail(resultBundle);
}
-------------------------------------------------------------------
-------------------------------------------------------------------
private void doAfterConnectFail(final Bundle resultBundle){
//
acquireWakeLock();
disconnected = true;
setConnectingState(false);
service.callbackToActivity(clientHandle, Status.ERROR,resultBundle);
   service.retryConnection(this);
releaseWakeLock();
}
-------------------------------------------------------------------





------------------

Jacarri Chan



_______________________________________________
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

-- 
Ian Craggs                          
icraggs@xxxxxxxxxx                 IBM United Kingdom
Paho Project Lead; Committer on Mosquitto


Back to the top