MQTT Read Timeout PROBLEM!!!

When receiving MQTT data from some PC clients,

After the EIdReadTimeoutException occurs, the data is all wrong.

If you look inside the procedure TTMSMQTTReaderThread.Work function, FConnection.Read (LBuffer, LRemainingLength, false)

FIdTcpClient.Socket.ReadTimeout:= 5000

This causes slow data reception to time out, and all subsequent data to go wrong during parsing.

Is there any particular reason why you set the timeout to 5 seconds?

Is there any other solution or can't we set the timeout to IdTimeoutInfinite?


We connect about 2000 clients, but it is currently happening with 3 clients.
If a problem occurs, the connection is disconnected or messages are not received. Alternatively, the message is truncated strangely, resulting in encoding errors, or JSON parsing fails.

TMS_MQTT_ISSUE.txt (26.1 KB)
This Log was recorded at the time when the problem occurred..

MQTT Server is rabbitMQ.