This message is the response from the broker to a client making
a CONNECT request.
bit |
|
|
|
|
|
|
|
|
byte 1 |
|
|
|
|
||||
|
|
|
|
|
|
|
|
|
byte 2 |
|
|||||||
|
|
|
|
|
|
|
|
The DUP, QoS and RETAIN flags are not used in the CONNACK message.
Note that at this version of the protocol, the flag is always 0 anyway,
so this is an academic point.
Enumeration | HEX | Meaning |
0 | 0x00 | Connection Accepted |
1 | 0x01 | Connection Refused: unacceptable protocol version |
2 | 0x02 | Connection Refused: identifier rejected |
3 | 0x03 | Connection Refused: broker unavailable |
4-255 | reserved for future use |
One of the reasons for a return code of 2 (identifier rejected) is that
it may be more than 23 characters long. The unique client identifier must
be 1-23 characters long. See the CONNECT section
for more information.
The format of the Variable Header is thus:
Description | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | |
Topic Name Compression Response | |||||||||
byte 1 | TNCOMP
Response |
|
|
|
|
|
|
|
|
Connect Return Code | |||||||||
byte 2 | Return Code |
|
|
|
|
|
|
|
|