Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [paho-dev] Lua client: Changing connect method

On Mon, Oct 6, 2014 at 10:43 PM, Bradley, Dwayne
<Dwayne.Bradley@xxxxxxxxxxxxxxx> wrote:

> Why not put the identifier in the create() method as well since it
> is a required piece of information for the connection?

It isn't strictly true that the client id is required, and certainly I
don't think this should be the case at the library level. A client id
is only really required if you're creating a durable (clean
session=false) client, or if you are using the id for some form of
identification/access control on the broker. For clean session=true
clients (again, assuming you're not using the client id for something
else), there is no reason why the library shouldn't generate a random
client id for you.

n MQTT v3.1.1, it is valid to send a zero length client id if you are
using clean session=true. In that case, the broker generates a client
id for you - you never know what it is.

Regards,

Roger


Back to the top