[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[paho-dev] Repeated calls callbackToActivity in MqttConnection
|
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();
}
-------------------------------------------------------------------
http://git.eclipse.org/c/paho/org.eclipse.paho.mqtt.java.git/tree/org.eclipse.paho.android.service/org.eclipse.paho.android.service/src/org/eclipse/paho/android/service/MqttConnection.java#n1000