Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Paho » MqttAsyncClient connect () infinite loop (MqttAsyncClient remians in a reciver infinete loop if the brocker does not answer to MQTT Connect message)
MqttAsyncClient connect () infinite loop [message #1836764] Wed, 13 January 2021 13:14
Angelo Primavera is currently offline Angelo PrimaveraFriend
Messages: 1
Registered: January 2021
Junior Member
Hello,

I observed the conditon descrived below that, from my poit of view, seams to be a bug.
I started a "dummy" brocker using netcat.
# nc -l -m 100 -k 10.60.2.43 1883
Then I started a MQTT client based on Paho MqttClient lib (v. 1.2.5)

The client is abviuosly able to open a socket and send the CONNET message but the "dummy" brocker does not answer to the request.

In this situation, the behaviour expected should be a socket close after a defined 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 (from line 169):

else {
// fix for bug 719
if (!clientComms.isConnected() && !clientComms.isConnecting()) {
throw new IOException("Connection is lost.");
}
}

Any suggetion to resolve the problem?
Thank you.
Angelo
Previous Topic:Paho: Latency/RTT of published Mqtt Messages
Next Topic:How to publish N messages per second from paho c publisher
Goto Forum:
  


Current Time: Fri May 03 03:53:28 GMT 2024

Powered by FUDForum. Page generated in 0.03273 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top