DISCONNECT

Disconnect notification


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.

Note that by sending the DISCONNECT message, the client is not implying anything about existing subscriptions: the subscriptions are persistant until either explicitly UNSUBSCRIBEd, or when there is a "clean start". QoS1 and QoS2 messages on topics to which the client is SUBSCRIBEd will be stored at the broker until the client reCONNECTs. QoS0 messages will not be retained, as they are delivered on a "best can do" basis.
 

Fixed Header

See the Fixed Header section for more information,
 
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
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.
 

Variable Header

NONE
 

Payload

NONE
 


Discussion

ASC
No confirmation is required for a DISCONNECT; after all, if the message doesn't get to the broker and the client just disconnects, it will discover this sooner or later anyway.
 

BACK to index 


Last Modified: 1-Jul-99