mosquitto_publish returns MOSQ_ERR_SUCCESS eventhough MQTT broker is not running

106 views
Skip to first unread message

sujitha

unread,
Mar 6, 2017, 4:13:34 AM3/6/17
to MQTT
Hi,

I connected to MQTT broker using Mosquitto client libraray.

I used below code for connection.
 ret = mosquitto_connect (mosq, MQTT_HOSTNAME, MQTT_PORT, 0);

After connecting to broker I stopped the broker service.

Now I tried to publish message using below code
ret = mosquitto_publish (mosq, NULL,topic,  strlen (text), text, 1, 1);
Eventhough the broker is running, mosquitto_publish API returns success.
When calling mosquitto_publish API second time, it returns 14.

Why mosquitto_publish returns success evethough the broker is running?How to fix this issue?

Thanks mosq advance.

kushal bhatta

unread,
Mar 7, 2017, 4:05:19 AM3/7/17
to MQTT
Could you please explain the scenario a bit clearly your statement seems to be confusing
Reply all
Reply to author
Forward
0 new messages