m = mqtt.Client("nca", 120, "my-CloudMQTT-username", "my-CloudMQTT-password")
m:on("connect", function(con) print ("connected") end)
m:on("offline", function(con) print ("offline") end)
m:connect("54.75.180.40", my-CloudMQTT-port, 0)
m:publish("/my-CloudMQTT-instance","hello",0,0, function(conn) print("published") end)After the connection attempt I immediately get the offline callback.