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
541 stars 135 forks source link

client_id bit size to short? #42

Closed rolandjitsu closed 10 years ago

rolandjitsu commented 10 years ago

Why does the bit size of the :client_id have to be shorter than 23?

I'm using the C implementation and that is not limited to 23 bits, I use it on a iOS device and I use the app identifier which is of the form: FBF68BA8-BAFB-41DE-8201-CDD73B7793FF.

Can that limit be increased?

njh commented 10 years ago

Version 3.1 of the MQTT Specification states:

The Client Identifier (Client ID) is between 1 and 23 characters long, and uniquely identifies the client to the server.

http://public.dhe.ibm.com/software/dw/webservices/ws-mqtt/mqtt-v3r1.html

I believe this will be relaxed when version 3.1.1 of the specification is released.

At that point there needs to be a way of specifying the version of the MQTT protocol to use, when connecting to the server.

rolandjitsu commented 10 years ago

@njh, I have just read that last night and found that the string cannot be longer than 23 characters. I've also opened an issue on the C lib with this issue, it seems like that lib does not complain about the length, perhaps it shortens it somewhere ... thanks