Closed rolandjitsu closed 10 years ago
I have just read the docs and I got an answer from the Ruby implementation of the mosquitto lib, 23 characters long is the maximum you can have as a clientId
in version 1.3.1. Therefore, I am a bit confused how does it still work without failing? Or does it just fail under the hood without any notice?
Yes, MQTT 3.1 specifies that a client ID should be between 1 and 23 characters long but Mosquitto does not enforce this. Note that MQTT 3.1.1 which is currently reviewed at OASIS will remove this restriction: http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/csprd01/mqtt-v3.1.1-csprd01.html#_Toc376954341
That is great news @jmesnil, if it will be approved I would be very happy, since I would like to use UUID as the client ID.
@jmesnil, I have looked over the source code of this lib and I can see that you don't explicitly limit the length of the
clientId
. But in the mosquitto lib, it is limited to a 23 bit length.Is there a reason why it is limited? Because with your lib I use a UUID for the
clientId
and it does not seem to complain, but with the other lib I cannot use a UUID. I'm just curious what is actually happening, does the C lib do the shorten string if it is to long or what is actually happening? The only reason I ask is because I want to be consistent with the client ids on both sides (the server and the iOS client).