The DISCONNECT message is sent from the client to the broker to indicate that it is about to close its TCP/IP connection. This allows for a clean disconnection, rather than just dropping the line.
Sending the DISCONNECT message does not affect existing subscriptions. They are persistent until they either explicitly unsubscribed, or if there is a clean start. The broker retains QoS 1 and QoS 1 messages for topics to which the client is unsubscribed until the client reconnects. QoS 0 messages are not retained, since they are delivered on a best efforts basis.
The fixed header format is shown in the table below.
bit | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
---|---|---|---|---|---|---|---|---|
byte 1 | Message Type (14) | DUP flag | QoS level | RETAIN | ||||
1 | 1 | 1 | 0 | x | x | x | x | |
byte 2 | Remaining Length (0) | |||||||
0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
The DUP, QoS, and RETAIN flags are not used in the DISCONNECT message.
Notices |
Trademarks |
Downloads |
Library |
Support |
Feedback
![]() ![]() |
ac10920_ |