Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [paho-dev] read buffer issue in embed C Paho



I am using MQTTClient-C library. I am assuming the payload to be null-character delimited. I guess I should be using payloadLength to delimit the payload.






From: Ian Craggs
Sent: Tuesday, November 28, 2017 10:16 PM
To: paho-dev@xxxxxxxxxxx
Subject: Re: [paho-dev] read buffer issue in embed C Paho



not sure which embedded client library you are using, MQTTPacket, MQTTClient or MQTTClient-C, but you are assuming that the message data is length delimited, not by null-character, aren't you?



On 28/11/2017 20:39, Pratheek Rai wrote:



I am using Eclipse Paho Embedded C in synchronous mode and I subscribe for only 1 topic. I try to publish message for the subscribed topic form my Java client ( also using Eclipse Paho). I am facing the following issue.

1) I publish message "Hello" from the Java client.

2) I receive "Hello" message. No problems here.

3) I publish "123" from Java client.

4) I receive "123lo" on the Embedded C client.

If I clear the read buffer every time I receive a message then this issue is not observed. Do I have to do anything special in the callback method other than reading the payload data from MessageData* data?

Thank you.


Pratheek Rai


paho-dev mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit

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


Back to the top