njh / ruby-mqtt

Pure Ruby gem that implements the MQTT protocol, a lightweight protocol for publish/subscribe messaging.
http://www.rubydoc.info/gems/mqtt
MIT License
538 stars 135 forks source link

Wrap packet id after 0xffff #118

Closed larsin closed 5 years ago

larsin commented 5 years ago

For long running connections, pub acks times out because packet id wraps on 65356, causing timeout errors for ever. This pr makes the packet id wrap and adds a contract to MQTT::Packet#encode_short.

njh commented 5 years ago

Thank you for this fix