Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[mosquitto-dev] strange disconnect being received


I'm running into a problem using libmosquitto (with c++ wrapper) and an
MQTT broker (I believe it's RabbitMQ)

Well, everything worked fine on our staging server, and now I've moved to
a production server and I'm getting weird disconnects from the broker.

Basically I successfully connect, but then immediately afterwards I get my
mosquitto disconnect callback triggered, with a return code of 7.

Now from the docs, the rc integer value indicates the reason for the

"A value of 0 means the client has called mosquitto_disconnect.  Any other
value indicates that the disconnect is unexpected."

What could cause a disconnect with a code of 7? My software works
perfectly fine with our staging MQTT broker, just not on the production

Using the command-line mosquitto_sub tool, I can connect to the broker
without any problems (on this production server).

I'm really stumped....any help would be greatly appreciated!

I'm using this wrapper to connect by the way if that's useful:

Back to the top