What happens when the limit of connections is reached?
Once the limit of connections is reached (for example, for the Serverless(Free) it is 100 concurrent connections), the next connection attempt will fail. The CONNACK packet will contain the error code, however which code, depends on whether it is an MQTT 5 or MQTT 3 client:
If the connecting client is MQTT 5 client, it will get the error:
CONNECT failed as CONNACK contained an Error Code: QUOTA_EXCEEDED
If the connecting client is MQTT 3 client, it will get the error:
CONNECT failed as CONNACK contained an Error Code: NOT_AUTHORIZED.
We suggest using MQTT 5 clients, as MQTT 5 specification supports detailed error reason codes which provide more detailed information for diagnostics and error handling.