MqttAsyncClient connect () infinite loop
Please fill out the form below before submitting, thank you!
- [x] Bug exists Release Version 1.2.5 ( Master Branch)
- [ ] Bug exists in MQTTv3 Client on Snapshot Version 1.2.6-SNAPSHOT (Develop Branch)
- [ ] Bug exists in MQTTv5 Client on Snapshot Version 1.2.6-SNAPSHOT (Develop Branch)
If this is a bug regarding the Android Service, please raise the bug here instead: https://github.com/eclipse/paho.mqtt.android/issues/new
Hello,
I observed the conditon described below that, from my poit of view, seams to be a bug. I started a "dummy" broker using netcat.
nc -l -m 100 -k 10.60.2.43 1883
Then I started a MQTT client based on Paho MqttCLient lib (version 1.2.5) that tries to connect to the dummy broker
In this scenario, the client is abviuosly able to open a socket and send the MQTT CONNET message but the "dummy" broker does not answer to the request.
The behaviour expected should be a socket close after a definied timeout. Instead the client remain in a infinete loop in the receiver thread:
13:53:34,879 FINE [org.eclipse.paho.client.mqttv3.internal.CommsReceiver] (MQTT Rec: MYCLIENT) MYCLIENT: network read message 13:53:35,880 FINE [org.eclipse.paho.client.mqttv3.internal.CommsReceiver] (MQTT Rec: MYCLIENT) MYCLIENT: network read message 13:53:36,881 FINE [org.eclipse.paho.client.mqttv3.internal.CommsReceiver] (MQTT Rec: MYCLIENT) MYCLIENT: network read message 13:53:37,882 FINE [org.eclipse.paho.client.mqttv3.internal.CommsReceiver] (MQTT Rec: MYCLIENT) MYCLIENT: network read message 13:53:38,883 FINE [org.eclipse.paho.client.mqttv3.internal.CommsReceiver] (MQTT Rec: MYCLIENT) MYCLIENT: network read message
My impression is that the problem is linked to the next code lines in org.eclipse.paho.client.mqttv3.internal.CommsReceiver: //LINE 169
`
else {
// fix for bug 719
if (!clientComms.isConnected() && !clientComms.isConnecting()) {
throw new IOException("Connection is lost.");
}
}
` I tried to recover from this condition calling disconect(), disconnectForcibly, close(true), but none of this methods works becasue of the current state of the client is "connecting". The only way to recover from this situation is to stop and restart the program, not applicable in a production environemnt.
Any suggetion to resolve the problem? Thank you.
Hi, i encounter the same in issue in my test with the verson 1.2.5 of the client. That was not the case with 1.2.0 before. Do you know if the problème exists in the SNAPSHOT version 1.2.6 and if it's ok to use it?
Thanks in advance