You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Under normal circumstances, these codes shouldn't come up. However, I have engineered my code to reconnect after a slight delay on disconnection. Due to #98 this code currently is being triggered frequently, leading to AdafruitIO throttling further connections.
It would be nice (and more future-safe as MQTT evolves) if CocoaMQTT could handle reserved values more gracefully. There may be other instances of this class of issue besides CONNACK.
The text was updated successfully, but these errors were encountered:
Background:
AdafruitIO has extended the MQTT protocol by adding two additional CONNACK return codes:
6: Connection Refused, throttled
7: Connection Refused, banned
https://io.adafruit.com/blog/mqtt/2016/06/28/extending-the-mqtt-protocol/
Under normal circumstances, these codes shouldn't come up. However, I have engineered my code to reconnect after a slight delay on disconnection. Due to #98 this code currently is being triggered frequently, leading to AdafruitIO throttling further connections.
Issue:
When the server returns a CONNACK message with a code other than the formally defined 0-5 (
http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc398718033 ), CocoaMQTT crashes in CocoaMQTT.didReceiveConnAck(reader:, connack:) at:
let ack = CocoaMQTTConnAck(rawValue: connack)!
The initializer for CocoaMQTTConnAck returns nil when passed a rawValue outside 0...5.
It would be nice (and more future-safe as MQTT evolves) if CocoaMQTT could handle reserved values more gracefully. There may be other instances of this class of issue besides CONNACK.
The text was updated successfully, but these errors were encountered: